Inheritance: UnityEngine.MonoBehaviour
示例#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);
        }
示例#2
0
 public void Reset()
 {
     wpIndex = 0;
     currentWaypoint = waypoints.ToArray().ElementAt(wpIndex);
 }