protected override void OnExecute(Command com) { Vector2d pos; DefaultData target; if (com.TryGetData <Vector2d>(out pos) && CanMove) { StartAttackMove(pos); } else if (com.TryGetData <DefaultData>(out target) && target.Is(DataType.UShort)) { isFocused = true; isAttackMoving = false; LSAgent tempTarget; ushort targetValue = (ushort)target.Value; if (AgentController.TryGetAgentInstance(targetValue, out tempTarget)) { Engage(tempTarget); } else { Debug.Log("nope"); } } }
protected override void OnExecute(Command com) { Agent.StopCast(this.ID); Vector2d pos; DefaultData target; if (com.TryGetData <Vector2d>(out pos) && CanMove) { if (HasTarget) { cachedMove.RegisterGroup(false); } else { cachedMove.RegisterGroup(); } isAttackMoving = true; isFocused = false; } else if (com.TryGetData <DefaultData> (out target) && target.Is(DataType.UShort)) { isFocused = true; isAttackMoving = false; LSAgent tempTarget; DefaultData data; ushort targetValue = (ushort)target.Value; AgentController.TryGetAgentInstance(targetValue, out tempTarget); Engage(tempTarget); } }