Exemplo n.º 1
0
    void updateActionUI()
    {
        if (!GameBattleUnitActionUI.instance.IsShow)
        {
            return;
        }

        if (confirm)
        {
            confirm = false;

            GameBattleUnit unit = GameBattleSelection.instance.SelectionUnit;

            if (unit != null)
            {
                switch (GameBattleUnitActionUI.instance.Selection)
                {
                case 0:
                {
                    GameBattleCursor.instance.show();

                    GameBattleUnitActionUI.instance.unShowFade();

                    unit.burst();

                    GameBattleSelection.instance.clearSelection();
                }
                break;

                case 1:
                {
                    GameBattleCursor.instance.unShow();

                    GameBattleUnitActionUI.instance.unShowFade();

                    GameBattleSkillUI.instance.show();
                    GameBattleSkillUI.instance.setData(unit);
                    GameBattleSkillUI.instance.showFade();
                }
                break;

                case 2:
                {
                    if (unit.checkEffect(GameSkillResutlEffect.Palsy))
                    {
                        return;
                    }

                    GameBattleCursor.instance.show();

                    GameBattleUnitActionUI.instance.unShowFade();

                    GameBattleUnitAttackSelection.instance.show(unit.PosX,
                                                                unit.PosY,
                                                                unit.Weapon,
                                                                unit.UnitCampType,
                                                                true);

                    GameBattleCursor.instance.moveTo(GameBattleUnitAttackSelection.instance.AttackCell.x,
                                                     GameBattleUnitAttackSelection.instance.AttackCell.y,
                                                     GameBattleCursor.SpeedX, GameBattleCursor.SpeedY,
                                                     true,
                                                     onCursorMoveOver);
                }
                break;

                case 3:
                {
                    GameBattleUnitActionItemUI.instance.show(GameBattleCursor.instance.PosX,
                                                             GameBattleCursor.instance.PosY);
                    GameBattleUnitActionItemUI.instance.showFade();

                    GameBattleUnitActionUI.instance.enable(false);
                }
                break;

                case 4:
                {
                    GameBattleCursor.instance.show();

                    GameBattleUnitActionUI.instance.unShowFade();

                    unit.action();

                    GameBattleSelection.instance.clearSelection();
                }
                break;
                }
            }
        }

        if (cancel)
        {
            cancel = false;

            GameBattleUnit unit = GameBattleSelection.instance.SelectionUnit;

            GameBattleUnitAttackSelection.instance.unShow();
            GameBattleUnitActionUI.instance.unShowFade();

            GameBattleCursor.instance.show();

            if (unit != null)
            {
                GameBattleCursor.instance.moveTo(unit.PosX, unit.PosY, true);
            }

            GameBattleSelection.instance.clearSelection();
        }

        moveBattleUnitActionUI();
    }