public override void OnBackButton()
 {
     if (state == State.MAIN)
     {
         MenuChangeDelay(MenuMode.MAP);
         objective.UpdateState(false);
     }
     else if (state == State.CONTROLS)
     {
         state = 0;
         ingameMenu.SetActive(true);
         objective.UpdateState(true);
         overlay.enabled = true;
         howTo.BackClicked();
     }
     else if (state == State.OPTION)
     {
         state = 0;
         ingameMenu.SetActive(true);
         objective.UpdateState(true);
         options.BackClicked();
     }
     else if (state == State.POPUP)
     {
         state = State.MAIN;
         prompt.Click(false);
     }
     menuBackEvent.Invoke();
 }
示例#2
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();
     }
 }