I would do this:
using UnityEngine;
using System.Collections;
public class PlayerHealth : MonoBehaviour {
public static PlayerHealth current;
public bool isDead;
void Start ()
{
current = this;
}
}
You can now access isDead wherever you like calling:
PlayerHealth.current.isDead
Also, current can say whatever you want it to say :)
↧