/// <summary>
        /// Orders the selected agent to move to a target location. If there is an enemy at that location, attack it.
        /// </summary>
        /// <param name="hit"></param>
        protected override void OnRightMouseButtonDown(RaycastHit hit)
        {
            if (!this.agent)
            {
                return;
            }

            var otherAgent = hit.transform.GetComponent <StratusAgent>();

            if (otherAgent)
            {
                this.agent.Target(otherAgent);
            }
            else
            {
                StratusAgentNavigation.DispatchMoveToEvent(agent, hit.point);
            }
        }
예제 #2
0
 /// <summary>
 /// Attemps to approach the current target of this action
 /// </summary>
 protected bool Approach(StratusAgent agent, Vector3 targetPosition)
 {
     return(StratusAgentNavigation.DispatchMoveToEvent(agent, targetPosition));
 }