Пример #1
0
 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);
     }
 }
Пример #2
0
 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);
 }
Пример #3
0
 void OnAttackComplete()
 {
     m_ActionState = ControllerActionState.Ready;
     m_ActionCompleteCallback.Invoke(ControllerActionType.Attack);
 }
Пример #4
0
 void OnMoveComplete(HexCell cell)
 {
     m_ActionState = ControllerActionState.Ready;
     m_ActionCompleteCallback.Invoke(ControllerActionType.Move);
 }