private static void UnLoad() { if (service != null) { EditorApplication.playModeStateChanged -= OnPlayModeStateChanged; Object.DestroyImmediate(service); service = null; } }
private static void Load() { if (service != null) { Debug.LogError("An instance of GhostCompilerService already exist."); return; } service = GhostCompilerService.LoadOrCreateService(); service.InitializeOnLoad(); EditorApplication.playModeStateChanged += OnPlayModeStateChanged; }