Esempio n. 1
0
        /// <summary>
        /// Callback for the path found. If it was successfull, update that path. If not and we have a target, request a new one.
        /// </summary>
        /// <param name="waypoints"></param>
        /// <param name="pathSuccessful"></param>
        private void OnPathFound(Node[] waypoints, bool pathSuccessful)
        {
            if (pathSuccessful == false)
            {
                if (GetTarget() != null)
                {
                    RequestPath(GetTarget().transform, true);
                }

                _steering.Stop();
                return;
            }
            _pathIndex = 0;
            _path      = new Path(waypoints, _myTransform.position, TurnDist, StoppingDist);
        }
Esempio n. 2
0
 /// <summary>
 /// Stop moving
 /// </summary>
 public void StopMoving()
 {
     _steering.Stop();
 }