Commit b54608a9 authored by mthiele2's avatar mthiele2
parents bb11d4dc 56397634
This diff is collapsed.
......@@ -2,6 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
using PlayerSpawnPointScript;
public class Life : MonoBehaviour {
......@@ -37,9 +38,9 @@ public class Life : MonoBehaviour {
public void Death(){
if (gameObject.CompareTag("Player"))
{
//PlayerSpawnPoint.psp.SetPlayerPosition();
gameObject.SetActive(false);
Heal(5);
SceneManager.LoadScene("MainLevel");
//gameObject.SetActive(false);
Heal(3);
Debug.Log("Death");
return;
......
......@@ -8,7 +8,7 @@ using UnityEngine.UI;
public class SavePoint : MonoBehaviour
{
private bool isUsed;
private Transform options;
public GameObject options;
public Button button;
private Animator anim;
......@@ -17,17 +17,17 @@ public class SavePoint : MonoBehaviour
isUsed = false;
button.interactable = false;
anim = GetComponent<Animator>();
//options = gameObject.transform.Find("Options");
Debug.Log(options);
}
public void OnTriggerEnter2D(Collider2D other)
{
//options.gameObject.SetActive(true);
options.gameObject.SetActive(true);
}
public void OnTriggerExit2D(Collider2D other)
{
//options.gameObject.SetActive(false);
options.gameObject.SetActive(false);
}
public void OnTriggerStay2D(Collider2D collision)
......
......@@ -36,7 +36,6 @@ namespace SavePointListScript
int i = 0;
foreach (GameObject var in savePointList)
{
Debug.Log(savePointIsActiv[i]);
SavePoint temp = savePointList[i].GetComponent<SavePoint>();
temp.SetIsUsed(savePointIsActiv[i]);
i++;
......
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