Ejemplo n.º 1
0
    /* Handles the selection of the option selected from the action based on the current selectIndex. */
    void handleSelection()
    {
        switch (selectIndex)
        {
            /* If "Move" is chosen, then... */
            case 0: cursorSel.SetMoveModeState(true);
                    moveChoosen = true;
                    cursorMove.SetPrevRow(cursorMove.GetCurrentRow());
                    cursorMove.SetPrevCol(cursorMove.GetCurrentCol());
                    gameController.SetPreviousMenu("action");
                    showCharActionMenu = false;
                    break;

            /* If "Attack" is chosen, then... */
            case 1: PlayerAttack playerAttack = GameObject.Find(cursorSel.GetSelectedPlayerCharName()).GetComponent<PlayerAttack>();
                    gameController.SetAttackModeState(true);
                    gameController.SetDisplayAttackRangeState(true);
                    playerAttack.SetCalculateAttackRange(true);
                    gameController.SetPreviousMenu("action");
                    showCharActionMenu = false;
                    break;

            /* If "Items" is chosen, then... */
            case 2: Debug.Log(selectIndex + " - " + actionMenuOptions[selectIndex] + " was choosen");
                    break;

            /* If "Wait" is chosen, then... */
            case 3: //Debug.Log(selectIndex + " - " + actionMenuOptions[selectIndex] + " was choosen");
                    showCharActionMenu = false;
                    waitChoosen = true;
                    charState = GameObject.Find(cursorSel.GetSelectedPlayerCharName()).GetComponent<CharacterState>();
                    charState.SetIsWaiting(true);
                    break;
        }
    }