]> git.lizzy.rs Git - SuperMouseAdventure.git/blobdiff - 2DGame/Assets/Scripts/Maus/MousePos.cs
Checkpoint-System v0.2
[SuperMouseAdventure.git] / 2DGame / Assets / Scripts / Maus / MousePos.cs
index 1c32cc6dc91fa6359d918e3c187698649ade8926..ecbb065da8951785b9cbf084cb217151d140df08 100644 (file)
@@ -7,18 +7,24 @@ public class MousePos : MonoBehaviour
 {
     private CheckpointManager checkpointManager;
 
+    Abyss abyss;
+
+    Health health;
+
     // Start is called before the first frame update
     void Start()
     {
-        checkpointManager = GameObject.FindGameObjectWithTag("Checkpointmanager").GetComponent<CheckpointManager>();
+        checkpointManager = GameObject.FindGameObjectWithTag("CheckpointManager").GetComponent<CheckpointManager>();
+        abyss = GetComponent<Abyss>();
+        health = GetComponent<Health>();
         transform.position = checkpointManager.lastCheckpointPos;
     }
 
     void Update()
     {
-        /**if()
+        if(abyss.fallenDown || health.mouseHealth <= 0)
         {
             SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
-        }*/
+        }
     }
 }