public static void LevelFail()
 {
     IntroLevelCanvasController.Instance.Hide();
     LevelCompleteCanvasController.Instance.Hide();
     InLevelCanvasController.Instance.Hide();
     LevelFailController.Instance.Show();
     OnLevelFailed?.Invoke();
 }
Пример #2
0
 /// <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);
             }
         }
     }
 }
Пример #3
0
 public void LevelFail()
 {
     OnLevelFailed?.Invoke(); lost = true;
 }