public override void Execute() { if (owner.currHealth <= 0) { owner.stateMachine.ChangeState(new Unit_Dead_(owner), StateMachine <Unit> .StateTransitionMethod.PopNPush); } else { UnitCommand command = owner.TryDequeueCommand(); if (command != null) { if (command.Perform <UnitKey>(owner)) { EventMgr.Instance.onUnitCommandResult.Invoke(new CommandResultParam(owner, true)); } else { EventMgr.Instance.onUnitCommandResult.Invoke(new CommandResultParam(owner, false)); } } } }