Commit a8cee5b3 by Tim Reiter
parents 20933192 6a9ec918
...@@ -10,7 +10,6 @@ public class PlayerHealth : MonoBehaviour { ...@@ -10,7 +10,6 @@ public class PlayerHealth : MonoBehaviour {
private bool alive = true; private bool alive = true;
private Scrollbar healthbar; private Scrollbar healthbar;
private PlayerControl playerControl; private PlayerControl playerControl;
private GameStateTracker gameStateTracker;
private bool hasShield = false; private bool hasShield = false;
public void init(int playerNumber) public void init(int playerNumber)
...@@ -31,7 +30,7 @@ public class PlayerHealth : MonoBehaviour { ...@@ -31,7 +30,7 @@ public class PlayerHealth : MonoBehaviour {
{ {
Debug.Log("Player " + name + " dead."); Debug.Log("Player " + name + " dead.");
alive = false; alive = false;
gameStateTracker.playerDied(name); ((GameStateTracker) Object.FindObjectOfType(typeof(GameStateTracker))).playerDied(name);
Destroy(gameObject); Destroy(gameObject);
} }
} }
......
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