Exemple #1
0
 public override void OnOkButton()
 {
     if (currentState == State.MAIN)
     {
         int mainIndex = mainButtons.GetPosition();
         if (mainIndex == 0)
         {
             currentState = State.OBJECTIVE;
             buttonMenuView.SetActive(false);
             objectiveView.SetActive(true);
             objective.UpdateState(true);
             menuAcceptEvent.Invoke();
         }
         else if (mainIndex == 1)
         {
             currentState = State.FORMATION;
             InputDelegateController.instance.TriggerMenuChange(MenuMode.FORMATION);
             mainMenuView.SetActive(false);
             menuCollectionView.SetActive(true);
             menuAcceptEvent.Invoke();
         }
         else if (mainIndex == 2)
         {
             currentState = State.INVENTORY;
             buttonMenuView.SetActive(false);
             inventoryView.SetActive(true);
             inventorySelect.GenerateList();
             menuAcceptEvent.Invoke();
         }
         else if (mainIndex == 3)
         {
             currentState = State.PROMPT;
             startPrompt.ShowYesNoPopup("Start mission?", false);
             menuAcceptEvent.Invoke();
         }
     }
     //else if (currentState == State.FORMATION) { }
     else if (currentState == State.INVENTORY)
     {
         inventorySelect.SelectItem();
         menuAcceptEvent.Invoke();
     }
     else if (currentState == State.OBJECTIVE)
     {
         objective.UpdateState(false);
         objectiveView.SetActive(false);
         buttonMenuView.SetActive(true);
         currentState = State.MAIN;
         menuAcceptEvent.Invoke();
     }
     else if (currentState == State.PROMPT)
     {
         if (startPrompt.Click(true) == MyPrompt.Result.OK1)
         {
             StartMission();
             menuAcceptEvent.Invoke();
         }
         currentState = State.MAIN;
     }
 }
    public override void OnMenuModeChanged()
    {
        bool active = UpdateState(MenuMode.INGAME);

        ingameMenu.SetActive(active);
        overlay.enabled = active;
        if (active)
        {
            ingameButtons.ForcePosition(0);
            objective.UpdateState(true);
        }
    }