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; } }
private void Awake() { if (!waypointLink) { return; } if (loadedWaypoints.ContainsKey(waypointLink)) { waypointLink = null; } else { loadedWaypoints.Add(waypointLink, this); } }
public void OnWaypointReached(WaypointLink waypointLink) { lastWaypointLink = waypointLink; }
public static bool TryGetWaypointFromLink(WaypointLink link, out Waypoint waypoint) { return(loadedWaypoints.TryGetValue(link, out waypoint)); }