//recalculate path points void Awake() { WaypointManager.AddPath(gameObject); //do not recalculate automatically with runtime created paths if (bPoints == null || bPoints.Count == 0) { return; } CalculatePath(); }
//auto-add to WaypointManager void Awake() { WaypointManager.AddPath(gameObject); }