Commit 5d24334d authored by Unknown's avatar Unknown

Merge remote-tracking branch 'origin/master'

parents 1ae31db5 61795bd8
...@@ -4,6 +4,7 @@ using UnityEngine; ...@@ -4,6 +4,7 @@ using UnityEngine;
using LevelauswahlScript; using LevelauswahlScript;
using PlayerSpawnPointScript; using PlayerSpawnPointScript;
using UnityEngine.UI; using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class SavePoint : MonoBehaviour public class SavePoint : MonoBehaviour
{ {
...@@ -32,15 +33,19 @@ public class SavePoint : MonoBehaviour ...@@ -32,15 +33,19 @@ public class SavePoint : MonoBehaviour
public void OnTriggerStay2D(Collider2D collision) public void OnTriggerStay2D(Collider2D collision)
{ {
if (Input.GetButtonDown("Interact")) if (collision.tag.Equals("Player"))
{ {
button.interactable = true; if (Input.GetButtonDown("Interact"))
isUsed = true; {
anim.SetBool("IsActive", true); button.interactable = true;
SaveSystem.SavePointUpdate(this); isUsed = true;
} else if (Input.GetButtonDown("Teleport") && Levelauswahl.la.auswahlIsActive() == false) anim.SetBool("IsActive", true);
{ SaveSystem.SavePointUpdate(this);
Levelauswahl.la.GetLevelauswahl(); }
else if (Input.GetButtonDown("Teleport") && Levelauswahl.la.auswahlIsActive() == false)
{
Levelauswahl.la.GetLevelauswahl();
}
} }
} }
...@@ -67,5 +72,6 @@ public class SavePoint : MonoBehaviour ...@@ -67,5 +72,6 @@ public class SavePoint : MonoBehaviour
{ {
SaveSystem.SavePointUpdate(this); SaveSystem.SavePointUpdate(this);
PlayerSpawnPoint.psp.SetPlayerToSafePoint(gameObject.transform.position); 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