Пример #1
0
        // PAINT METHODS: -------------------------------------------------------------------------

        void OnGUI()
        {
            this.InitializeStyles();
            if (ModuleManagerWindow.WINDOW == null)
            {
                ModuleManagerWindow.OpenModuleManager();
            }

            EditorGUILayout.BeginHorizontal();
            this.sidebarScroll = EditorGUILayout.BeginScrollView(
                this.sidebarScroll,
                false, false,
                GUIStyle.none,
                GUIStyle.none,
                this.sidebarStyle,
                GUILayout.MinWidth(WINDOW_SIDE_WIDTH),
                GUILayout.MaxWidth(WINDOW_SIDE_WIDTH),
                GUILayout.ExpandHeight(true)
                );

            this.PaintSidebar();

            EditorGUILayout.EndScrollView();
            Rect borderRect = GUILayoutUtility.GetRect(1f, 1f, GUILayout.ExpandHeight(true), GUILayout.Width(1f));

            EditorGUI.DrawTextureAlpha(borderRect, Texture2D.blackTexture);

            EditorGUILayout.BeginVertical();

            this.PaintContent();

            EditorGUILayout.EndVertical();
            EditorGUILayout.EndHorizontal();
        }
Пример #2
0
        public static void OpenModuleManager()
        {
            Rect windowRect = new Rect(0f, 0f, WINDOW_W, WINDOW_H);

            ModuleManagerWindow.WINDOW = EditorWindow.GetWindowWithRect <ModuleManagerWindow>(
                windowRect, true, WINDOW_TITLE, true
                );

            ModuleManager.SetDirty();
            ModuleManagerWindow.WINDOW.Show();

            #if UNITY_2018_1_OR_NEWER
            EditorApplication.hierarchyChanged += ModuleManager.SetDirty;
            #else
            EditorApplication.hierarchyWindowChanged += ModuleManager.SetDirty;
            #endif
        }