private void Setup() { getsOnGUIEvents = true; getsLayoutEvents = true; if (instance != null) { if (instance != this) { instance.Close(); } } instance = this; minSize = new Vector2(0f, 0f); maxSize = new Vector2(0f, 0f); position = new Rect(100000f, 100000f, 0f, 0f); Show(); #if UNITY_2018_1_OR_NEWER EditorApplication.quitting += instance.OnApplicationQuitting; AssemblyReloadEvents.beforeAssemblyReload += instance.OnBeforeAssemblyReload; #endif Repaint(); GUI.changed = true; }
private static OnGUIEventHelper Instance() { if (instance == null) { instance = GetWindow <OnGUIEventHelper>(false); if (!setupDone) { instance.Setup(); } } return(instance); }