void Awake() { singleton = this; config.Setup(); UpdateRenderPoint(Vector3.zero); detector = GetComponent <DistanceDetector>(); detector.onEscape.AddListener(() => UpdateRenderPoint(detector.TargetPosition())); }
void Update() { if (detector.IsTargetTooFar()) { UpdateRenderPoint(detector.TargetPosition()); } if (renderNavMesh && navMeshDirty && AreAllChunksRendered()) { SetNavMeshLinks(); navMeshSurface.BuildNavMeshAsync(); navMeshDirty = false; } }