public void findAdditiveLinks() { if (previousAdditiveWaypoint != null || nextAdditiveWaypoint != null) { AdditiveWaypointsManager.Instance.waypoints.Add(this); } if (previousAdditiveWaypoint != null && previousWaypoint == null) { WaypointData additiveWaypoint = AdditiveWaypointsManager.Instance.getByName(previousAdditiveWaypoint); if (additiveWaypoint != null) { previousWaypoint = additiveWaypoint; previousWaypoint.findAdditiveLinks(); } } if (nextAdditiveWaypoint != null && nextWaypoint == null) { WaypointData additiveWaypoint = AdditiveWaypointsManager.Instance.getByName(nextAdditiveWaypoint); if (additiveWaypoint != null) { nextWaypoint = additiveWaypoint; nextWaypoint.findAdditiveLinks(); } } }
public void Start() { // run this on start as AdditiveWaypointsManager instances in Awake if (AdditiveWaypointsManager.Instance != null) { data.findAdditiveLinks(); } }