Exemple #1
0
    public void HandleAction(AgentAction action)
    {
        //if(Owner.debugAnims) Debug.Log(Time.timeSinceLevelLoad + " " +  gameObject.name  + " handle action " + action.ToString());

        if (enabled == false || action.IsFailed())
        {
            return;
        }

        if (action is AgentActionWeaponChange)
        {
            if (Owner.IsAlive)
            {
                StartCoroutine(SwitchWeapon(action as AgentActionWeaponChange));
            }
            return;
        }

/*		//THROW_RUN_2
 *              if (action is AgentActionUseItem)
 *              {
 *                      StartCoroutine( ThrowItem(action as AgentActionUseItem) );
 *                      return;
 *              }
 */
        if (FSM.DoAction(action) == false)
        {
            action.SetFailed();
        }
    }
Exemple #2
0
 public void  HandleAction(AgentAction _action)
 {
     if (!_action.IsFailed())
     {
         FSM.DoAction(_action);
     }
 }
Exemple #3
0
    public void HandleAction(AgentAction _action)
    {
        if (_action.IsFailed())
        {
            return;
        }

        FSM.DoAction(_action);
    }
Exemple #4
0
    public void HandleAction(ActionBase action)
    {
        if (action.IsFailed())
        {
            return;
        }

        FSM.DoAction(action);
    }