Exemplo n.º 1
0
 public override void OnBackButton()
 {
     if (currentState == State.CONTROLS)
     {
         currentState = State.MAIN;
         howTo.BackClicked();
         startMenuView.SetActive(true);
         menuBackEvent.Invoke();
     }
     else if (currentState == State.LOAD)
     {
         if (saveFileController.BackClicked())
         {
             currentState = State.MAIN;
             startMenuView.SetActive(true);
             saveView.SetActive(false);
             menuBackEvent.Invoke();
         }
     }
     else if (currentState == State.OPTIONS)
     {
         currentState = State.MAIN;
         optionsController.BackClicked();
         startMenuView.SetActive(true);
         saveGameEvent.Invoke();
         menuBackEvent.Invoke();
     }
     else if (currentState == State.CHANGELOG)
     {
         currentState = State.MAIN;
         changelogView.SetActive(false);
         menuBackEvent.Invoke();
     }
 }
Exemplo n.º 2
0
 public override void OnBackButton()
 {
     if (isPrompt)
     {
         isPrompt = false;
         savePrompt.Click(false);
         menuBackEvent.Invoke();
     }
     else if (saveFileController.BackClicked())
     {
         isPrompt = true;
         savePrompt.ShowYesNoPopup("Continue without saving?", false);
         menuBackEvent.Invoke();
     }
 }