public void LoseHealth() { Health--; if (Health <= 0) { pause.DoGameOver("You died!\n(Hint: Grab stars to restore health!)"); } }
public void CompleteStar(int instanceId) { if (bigStar.gameObject.GetInstanceID() == instanceId) { pause.DoGameOver(string.Format(GAME_OVER_TEXT, this.timer.GetTimeFormatted())); return; } health.GainHealth(); dict[instanceId].SetColor(false); dict.Remove(instanceId); if (dict.Count == 0) { bigStar.ActivateStar(); } }
private IEnumerator StartAssigningTasks() { int highestPossibleScore = 0; yield return(new WaitForSeconds(timeUntilFirstTaskIsAssigned)); foreach (TaskBundle task in tasksToDo) { Waypoint[] waypoints = current.GetRandomWaypoints(task.NumberOfTasks); foreach (Waypoint waypoint in waypoints) { highestPossibleScore += scorePerTask; AddTask(task.SecondsPerTask, waypoint, waypoint.WaypointName, scorePerTask); } yield return(new WaitForSeconds(task.SecondsUntilNextTaskGroup)); } pause.DoGameOver("null"); // FIXME }