Commit ebd9a8f0 authored by Isa's avatar Isa

Levelauswahl an Checkpoint

parent 5b26c471
fileFormatVersion: 2
guid: 08dc8f5ec5b68dd4c80a59ba7da9b6a6
guid: 50a0ddec8ac259c46a58a6b5324a759d
PrefabImporter:
externalObjects: {}
userData:
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2108024439
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2108024440}
- component: {fileID: 2108024442}
- component: {fileID: 2108024441}
m_Layer: 0
m_Name: Options
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &2108024440
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2108024439}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.98, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 395035932932740992}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &2108024442
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2108024439}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!102 &2108024441
TextMesh:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2108024439}
m_Text: 'E - Speichern
T - Teleport'
m_OffsetZ: 0
m_CharacterSize: 0.46
m_LineSpacing: 1
m_Anchor: 7
m_Alignment: 1
m_TabSize: 4
m_FontSize: 0
m_FontStyle: 0
m_RichText: 1
m_Font: {fileID: 0}
m_Color:
serializedVersion: 2
rgba: 4294967295
--- !u!1 &395035932932740994
GameObject:
m_ObjectHideFlags: 0
......@@ -11,6 +104,7 @@ GameObject:
- component: {fileID: 395035932932740992}
- component: {fileID: 395035932932740995}
- component: {fileID: 395035932932740993}
- component: {fileID: 26295510}
m_Layer: 0
m_Name: SavePoint
m_TagString: Untagged
......@@ -28,7 +122,8 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -6.34, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Children:
- {fileID: 2108024440}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -60,3 +155,51 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 9627da6bb4534054e8a7065f1c4974f3, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!212 &26295510
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 395035932932740994}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 3fc2bbd409bf34ab6af1637bab569da1, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 2, y: 2}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
This diff is collapsed.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using LevelauswahlScript;
public class SavePoint : MonoBehaviour
{
private bool isUsed;
private Transform options;
private void Start()
{
isUsed = false;
options = gameObject.transform.Find("Options");
}
public void OnTriggerEnter2D(Collider2D other)
{
options.gameObject.SetActive(true);
}
public void OnTriggerExit2D(Collider2D other)
{
options.gameObject.SetActive(false);
}
public void OnTriggerStay2D(Collider2D collision)
{
if (Input.GetButtonDown("Interact"))
{
SaveSystem.SavePointUpdate(this);
isUsed = true;
SaveSystem.SavePointUpdate(this);
isUsed = true;
} else if (Input.GetButtonDown("Teleport") && Levelauswahl.la.auswahlIsActive() == false)
{
Levelauswahl.la.GetLevelauswahl();
}
}
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace LevelauswahlScript
{
public class Levelauswahl : MonoBehaviour
{
public static Levelauswahl la;
public GameObject Auswahl;
private EventSystem _myEventSystem;
public Button firstSelect;
// Start is called before the first frame update
void Start()
{
la = this;
_myEventSystem = EventSystem.current;
}
private void Update()
{
if (Input.GetButtonDown("Cancel") && Auswahl.activeSelf == true)
{
Resume();
}
}
IEnumerator highlightBtn()
{
_myEventSystem.SetSelectedGameObject(null);
yield return null;
_myEventSystem.firstSelectedGameObject = firstSelect.gameObject;
_myEventSystem.SetSelectedGameObject(_myEventSystem.firstSelectedGameObject);
}
// Update is called once per frame
public void GetLevelauswahl()
{
Auswahl.SetActive(true);
StartCoroutine("highlightBtn");
Time.timeScale = 0f;
}
public void Resume()
{
Auswahl.SetActive(false);
Time.timeScale = 1f;
}
public bool auswahlIsActive()
{
return Auswahl.activeSelf;
}
}
}
fileFormatVersion: 2
guid: bd7654f39d82d9742878d42de58171d8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -309,3 +309,19 @@ InputManager:
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Teleport
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: t
altNegativeButton:
altPositiveButton: joystick button 1
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment