Commit 61795bd8 authored by Michael But's avatar Michael But

SavePoint letzte Änderung (Tag-Abfrage und Scene laden).

parent 07b8f5b2
......@@ -4,6 +4,7 @@ using UnityEngine;
using LevelauswahlScript;
using PlayerSpawnPointScript;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class SavePoint : MonoBehaviour
{
......@@ -31,6 +32,8 @@ public class SavePoint : MonoBehaviour
}
public void OnTriggerStay2D(Collider2D collision)
{
if (collision.tag.Equals("Player"))
{
if (Input.GetButtonDown("Interact"))
{
......@@ -38,11 +41,13 @@ public class SavePoint : MonoBehaviour
isUsed = true;
anim.SetBool("IsActive", true);
SaveSystem.SavePointUpdate(this);
} else if (Input.GetButtonDown("Teleport") && Levelauswahl.la.auswahlIsActive() == false)
}
else if (Input.GetButtonDown("Teleport") && Levelauswahl.la.auswahlIsActive() == false)
{
Levelauswahl.la.GetLevelauswahl();
}
}
}
public bool GetIsUsed()
{
......@@ -67,5 +72,6 @@ public class SavePoint : MonoBehaviour
{
SaveSystem.SavePointUpdate(this);
PlayerSpawnPoint.psp.SetPlayerToSafePoint(gameObject.transform.position);
SceneManager.LoadScene("MainLevel");
}
}
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