public bool Move(HexCell destination, int distance) { if (m_ActionState == ControllerActionState.Ready && m_Movement != null && m_Movement.MoveTo(destination, distance)) { m_ActionState = ControllerActionState.DoingAction; return(true); } else { return(false); } }
public bool Attack(Entity target) { if (m_ActionState == ControllerActionState.Ready && target != null && target != entity) { int distance = target.centerCell.GetDistance(entity.centerCell); int attackDistance = (int)m_PropertyComponent.attackRange; if (attackDistance >= distance) { //在攻击范围内,直接攻击 m_AttackComponent.Attack(target); m_ActionState = ControllerActionState.DoingAction; return(true); } } return(false); }
void OnAttackComplete() { m_ActionState = ControllerActionState.Ready; m_ActionCompleteCallback.Invoke(ControllerActionType.Attack); }
void OnMoveComplete(HexCell cell) { m_ActionState = ControllerActionState.Ready; m_ActionCompleteCallback.Invoke(ControllerActionType.Move); }