protected override void Awake() { base.Awake(); AstarPath.active = this; if (UnityEngine.Object.FindObjectsOfType(typeof(AstarPath)).Length > 1) { UnityEngine.Debug.LogError("You should NOT have more than one AstarPath component in the scene at any time.\nThis can cause serious errors since the AstarPath component builds around a singleton pattern."); } base.useGUILayout = false; if (!Application.isPlaying) { return; } if (AstarPath.OnAwakeSettings != null) { AstarPath.OnAwakeSettings(); } GraphModifier.FindAllModifiers(); RelevantGraphSurface.FindAllGraphSurfaces(); this.InitializePathProcessor(); this.InitializeProfiler(); this.ConfigureReferencesInternal(); this.InitializeAstarData(); this.FlushWorkItems(); this.euclideanEmbedding.dirty = true; if (this.scanOnStartup && (!this.data.cacheStartup || this.data.file_cachedStartup == null)) { this.Scan(null); } }
private void Awake() { AstarPath.active = this; base.useGUILayout = false; if (!Application.isPlaying) { return; } if (AstarPath.OnAwakeSettings != null) { AstarPath.OnAwakeSettings(); } this.InitializePathProcessor(); this.InitializeProfiler(); this.SetUpReferences(); this.InitializeAstarData(); this.FlushWorkItems(); this.euclideanEmbedding.dirty = true; if (this.scanOnStartup && (!this.astarData.cacheStartup || this.astarData.file_cachedStartup == null)) { UnityEngine.Debug.Log("doing scan"); this.Scan(); } }