Esempio n. 1
0
    private void AttackOnClickedCube()
    {
        TurnMgr_State_ nextState = new TurnMgr_PlayerBegin_(owner, unit);

        owner.stateMachine.ChangeState(
            new TurnMgr_WaitSingleEvent_(owner, unit, EventMgr.Instance.onUnitIdleEnter, nextState,
                                         (param) => ((UnitStateEvent)param)._owner == unit),
            StateMachine <TurnMgr> .StateTransitionMethod.JustPush);

        unit.StopBlink();

        List <Cube> cubesToAttack = MapMgr.Instance.GetCubes(unit.basicAttackSplash, cubeClicked);

        AttackCommand attackCommand;

        if (AttackCommand.CreateCommand(unit, cubeClicked, out attackCommand))
        {
            unit.EnqueueCommand(attackCommand);
        }
    }