Esempio n. 1
0
        private void GoToWaypoint(WaypointLink waypointLink)
        {
            if (waypointLink == false || waypointLink.IsTargetLoaded == false)
            {
                return;
            }

            if (Waypoint.TryGetWaypointFromLink(waypointLink, out var waypoint))
            {
                lastWaypointLink   = waypointLink;
                transform.position = waypoint.Position;
            }
        }
Esempio n. 2
0
        private void Awake()
        {
            if (!waypointLink)
            {
                return;
            }

            if (loadedWaypoints.ContainsKey(waypointLink))
            {
                waypointLink = null;
            }
            else
            {
                loadedWaypoints.Add(waypointLink, this);
            }
        }
Esempio n. 3
0
 public void OnWaypointReached(WaypointLink waypointLink)
 {
     lastWaypointLink = waypointLink;
 }
Esempio n. 4
0
 public static bool TryGetWaypointFromLink(WaypointLink link, out Waypoint waypoint)
 {
     return(loadedWaypoints.TryGetValue(link, out waypoint));
 }