Пример #1
0
    void PossibleTargetInTrigger(Collider collider)
    {
        // If the agent is not in combat task, do nothing.
        if (_states.GetTask() != EAntTasks.Attack)
        {
            return;
        }

        // Notify attack script about new target.
        _attack.AcquireNewTarget(collider.gameObject);

        // Change to combat state (which may be left immediately, see AgentCombat).
        if (_states.GetTask() == EAntTasks.Attack)
        {
            _states.currentState = EAntStates.Combat;
        }
    }
Пример #2
0
 /**
  * When a collider entered, notify the Attack component.
  */
 void OnTriggerEnter(Collider collider)
 {
     _attack.AcquireNewTarget(collider.gameObject);
 }