Ejemplo n.º 1
0
    void UpdateSkillsMenu()
    {
        //------------------
        if (sm.TimeInState > 0.2f)
        {
            if (simpleMenuDisplay.gameObject.activeSelf == false)
            {
                simpleMenuDisplay.gameObject.SetActive(true);
                //return early, but still counts as part of the delay.
                delayInput -= Time.deltaTime;
                return;
            }
        }
        //Ignore input for time...
        if (delayInput > 0f)
        {
            delayInput -= Time.deltaTime;
            return;
        }
        //Call menu update:
        simpleMenuDisplay.DoUpdate();
        skillCursorMemory = simpleMenuDisplay.cursorIndex;
        //------------------
        //UPDATE:


        //TODO: Make it so you can press left/right to select a different weapon, causing new skills to be drawn.
        //(reset cursor memory if you do that, or make a new memory int for each weapon type
        if (GetBack())
        {
            //TODO!
            // now I need an option to go back if you want to cancel all of the commands!
            //you'll need to add the previous menu to RpgBattleSystemMain.instance.menusInputQueueList!!
            bool success = RpgBattleSystemMain.instance.GoBackToPreviousMenu();
            if (success == false)
            {
                //TODO: Play error sound.
            }
        }
        if (GetConfirm())
        {
            //select using cursor index of simple menu
            menuInterface.SetSkill(menuInterface.GetSkillList()[simpleMenuDisplay.cursorIndex]);
            //TODO: Actually, go to the target select menu instead of the inactive state, but I'll do this for now...
            //target select mode should be dictated by skill selected!
            //define in skill definitions file!
            sm.SetState(MenuState.selectTarget);
            simpleMenuDisplay.gameObject.SetActive(false);
            //NOTE: THE TYPE OF TARGET THAT YOU CAN SELECT SHOULD BE DEFINED PER SKILL!
            //HEALING SPELLS SHOULD TARGET HERO PARTY, BUT IF YOU WANT TO MAKE A GAME WHERE
            //YOU CAN HURT OR HEAL ANYTHING, YOU SHOULD BE ABLE TO WITHOUT MODDING THE ENGINE!
        }
    }
 // Update is called once per frame
 void Update()
 {
     if (currentMenu != null)
     {
         currentMenu.DoUpdate();
     }
 }