Inheritance: UnityEngine.MonoBehaviour
Exemplo n.º 1
0
        public Waypoint NextWaypoint()
        {
            if (wpIndex >= (waypoints.Count - 1)) {
                if (type == Type.ReverseOnEnd) {
                    waypoints.Reverse();
                    wpIndex = 0;
                } else if (type == Type.Circular) {
                    wpIndex = 0;
                }
            } else {
                wpIndex++;
            }

            return currentWaypoint = waypoints.ToArray().ElementAt(wpIndex);
        }
Exemplo n.º 2
0
 public void Reset()
 {
     wpIndex = 0;
     currentWaypoint = waypoints.ToArray().ElementAt(wpIndex);
 }