private void Awake() { var airDebugger = TryGetInstance(); if (airDebugger != this) { Debug.LogWarning("AirDebugger already instantiated."); invalid = true; return; } DontDestroyOnLoad(gameObject); ConnectToEditor.RegisterMessageHandler( ECMID.Inspector, OnEditorInspectorMessageReceived); SceneManager.activeSceneChanged += OnSceneChanged; }
private void OnDestroy() { SceneManager.activeSceneChanged -= OnSceneChanged; ConnectToEditor.UnregisterMessageHandler( ECMID.Inspector, OnEditorInspectorMessageReceived); }