Пример #1
0
    //Move Panel
    private void HandleBattleMoveSelection()
    {
        ghostTarget[currentChooseTarget].GetComponent <BattleHud>().DeactivateTarget();

        if (Input.GetKeyDown(right))
        {
            if (currentActionBattleMove < 3)
            {
                currentActionBattleMove++;
            }
        }
        else if (Input.GetKeyDown(left))
        {
            if (currentActionBattleMove > 0)
            {
                currentActionBattleMove--;
            }
        }
        else if (Input.GetKeyDown(down))
        {
            if (currentActionBattleMove < 2)
            {
                currentActionBattleMove += 2;
            }
        }
        else if (Input.GetKeyDown(up))
        {
            if (currentActionBattleMove > 1)
            {
                currentActionBattleMove -= 2;
            }
        }

        playerHud.UpdateBattleMoveAction(currentActionBattleMove);

        if (Input.GetKeyDown(confirmBtn))
        {
            var moveType = moveSet.getCurrentMoves()[currentActionBattleMove].getMoveBase().getTargetType();
            if (moveType == targetType.Enemy)
            {
                state = BattleState.ChooseTarget;
            }
            else if (moveType == targetType.Aoe)
            {
                PlayerMove(currentActionBattleMove);
            }
            else if (moveType == targetType.Debuff)
            {
                state = BattleState.ChooseTarget;
            }
            else
            {
                PlayerMove(currentActionBattleMove);
            }
        }
        else if (Input.GetKeyDown(backBtn))
        {
            currentActionBattle = 0;
            state = BattleState.PlayerBattle;
            playerHud.CloseSkill();
        }
    }