Пример #1
0
        private void OnEnable()
        {
            window = this;

            // Tabs
            List <TabContainer> tabsList = new List <TabContainer>();

            tabsList.Add(new TabContainer("Info", window.TabInfo, -1));

            Assembly assembly = Assembly.GetAssembly(typeof(SetupTabAttribute));

            Type[] gameTypes = assembly.GetTypes().Where(m => m.IsDefined(typeof(SetupTabAttribute), true)).ToArray();

            foreach (Type type in gameTypes)
            {
                //Get attribute
                SetupTabAttribute[] tabAttributes = (SetupTabAttribute[])Attribute.GetCustomAttributes(type, typeof(SetupTabAttribute));

                for (int i = 0; i < tabAttributes.Length; i++)
                {
                    UnityEngine.Object tabObject = EditorUtils.GetAsset(type);
                    if (tabObject != null)
                    {
                        tabsList.Add(new TabContainer(tabAttributes[i].tabName, tabObject, tabAttributes[i].priority));
                    }
                }
            }

            tabContainers = tabsList.OrderBy(x => x.priority).ToArray();
            tabs          = new string[tabContainers.Length];
            for (int i = 0; i < tabs.Length; i++)
            {
                tabs[i] = tabContainers[i].name;
            }

            //Buttons
            //Project settings
            for (int i = 0; i < projectSettings.Length; i++)
            {
                projectSettings[i].Init();
            }

            //Project folders
            for (int i = 0; i < projectFolders.Length; i++)
            {
                projectFolders[i].Init();
            }

            //Project files
            for (int i = 0; i < projectFiles.Length; i++)
            {
                projectFiles[i].Init();
            }

            EditorCoroutines.Execute(GetRequest(PROTOTYPE_URL));
        }
Пример #2
0
        static void ShowWindow()
        {
            SetupGuideWindow tempWindow = (SetupGuideWindow)GetWindow(typeof(SetupGuideWindow), true, WINDOW_TITLE);

            tempWindow.minSize = WINDOW_SIZE;
            tempWindow.maxSize = WINDOW_SIZE;

            window = tempWindow;

            EditorStylesExtended.InitializeStyles();
        }
Пример #3
0
        public static void SetupGuideStartup()
        {
            if (EditorPrefs.HasKey("ShowStartupGuide"))
            {
                return;
            }

            EditorApplication.delayCall += delegate
            {
                SetupGuideWindow.ShowWindow();
            };

            EditorPrefs.SetBool("ShowStartupGuide", true);
        }