public static void HideEditor() { if (f != null) { f = (GridWindow)EditorWindow.GetWindow(typeof(GridWindow), false, "GridEditor2D"); f.Close(); DestroyImmediate(f); f = (GridWindow)ScriptableObject.CreateInstance(typeof(GridWindow)); f.Init(); } }
public static void ShowEditor() { if (f == null) { f = (GridWindow)EditorWindow.GetWindow(typeof(GridWindow), false, "GridEditor2D"); f.Show(); f.minSize = new Vector2(220f, 400f); f.Init(); } else { if (f.grid) { if (!f.grid.DrawEditorInSceneGUI) { f.Show(); } } } }