public void UpdateLives() { string text = lives.GetLives() > 0 ? "Employees Left: " + lives.GetLives().ToString() : "NO MORE EMPLOYEES"; foreach (TextMesh textMesh in textMeshes) { textMesh.text = text; } }
void Start() { lives = GameObject.FindObjectOfType <PlayerLives>(); textMeshes = GetComponentsInChildren <TextMesh>(); foreach (TextMesh textMesh in textMeshes) { textMesh.text = lives.GetLives().ToString(); } UpdateLives(); }
public int GetLives() { return(lives.GetLives()); }