public static void LevelFail() { IntroLevelCanvasController.Instance.Hide(); LevelCompleteCanvasController.Instance.Hide(); InLevelCanvasController.Instance.Hide(); LevelFailController.Instance.Show(); OnLevelFailed?.Invoke(); }
/// <summary> /// Called everytime a fail condition is met. The condition gameobject is added to a list. /// When enough fail conditions are met the level manager calls the OnLevelFailed event. /// A gameobject can only have one appearance in each list. /// </summary> private void FailConditionMet(GameObject condition) { if (!failConditionsList.Contains(condition)) { failCounter++; failConditionsList.Add(condition); if (failCounter >= failConditionsToFail) { if (!levelAlreadyEnded) { levelAlreadyEnded = true; OnLevelFailed?.Invoke(); DestroyAllObjectsInScene(sceneObjects); } } } }
public void LevelFail() { OnLevelFailed?.Invoke(); lost = true; }