コード例 #1
0
        public static void PaintSidebarStore()
        {
            switch (ModuleManagerStore.REQUEST_STATUS)
            {
            case ModuleManagerStore.StoreRequestStatus.None:
                ModuleManagerStore.LoadStoreModules();
                break;

            case ModuleManagerStore.StoreRequestStatus.Error:
                EditorGUILayout.BeginVertical();
                GUILayout.FlexibleSpace();
                EditorGUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();
                if (GUILayout.Button("Try again", GetTryAgainButtonStyle()))
                {
                    ModuleManagerStore.LoadStoreModules();
                }
                GUILayout.FlexibleSpace();
                EditorGUILayout.EndHorizontal();
                GUILayout.FlexibleSpace();
                EditorGUILayout.EndVertical();
                break;

            case ModuleManagerStore.StoreRequestStatus.Requesting:
                EditorGUILayout.BeginVertical();
                GUILayout.FlexibleSpace();
                EditorGUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();
                GUILayout.Button("Connecting...", GetLoadingButtonStyle());
                GUILayout.FlexibleSpace();
                EditorGUILayout.EndHorizontal();
                GUILayout.FlexibleSpace();
                EditorGUILayout.EndVertical();
                break;

            case ModuleManagerStore.StoreRequestStatus.Complete:
                Module[] modules = ModuleManager.GetStoreModules();
                for (int i = 0; i < modules.Length; ++i)
                {
                    GUIContent text = new GUIContent(
                        modules[i].displayName,
                        ModuleManager.GetModuleIcon(modules[i].moduleID)
                        );

                    if (ModuleManagerSidebar.PaintButton(text, ModuleManagerWindow.WINDOW.sidebarIndex == i))
                    {
                        ModuleManagerWindow.WINDOW.sidebarIndex = i;
                        ModuleManagerWindow.WINDOW.Repaint();
                    }
                }
                break;
            }
        }
コード例 #2
0
 private static void LoadStoreModules()
 {
     STORE_MODULES      = new Dictionary <string, Module>();
     STORE_MODULES_LIST = new Module[0];
     ModuleManagerStore.LoadStoreModules();
 }