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)); }
public static void InitializeStyles() { if (isInited) { return; } if (!editorSkin) { if (EditorGUIUtility.isProSkin) { editorSkin = EditorUtils.GetAsset <GUISkin>(GUISKIN_PRO_NAME); } if (!editorSkin) { editorSkin = EditorUtils.GetAsset <GUISkin>(GUISKIN_NAME); } } if (editorSkin) { LoadIcons(); tab = editorSkin.GetStyle("Tab"); box_01 = editorSkin.GetStyle("box_01"); box_02 = editorSkin.GetStyle("box_02"); box_03 = editorSkin.GetStyle("box_03"); label_small = editorSkin.GetStyle("label_small"); label_small_bold = editorSkin.GetStyle("label_small_bold"); label_medium = editorSkin.GetStyle("label_medium"); label_medium_bold = editorSkin.GetStyle("label_medium_bold"); label_large = editorSkin.GetStyle("label_large"); label_large_bold = editorSkin.GetStyle("label_large_bold"); button_01 = editorSkin.GetStyle("button_01"); button_01_large = editorSkin.GetStyle("button_01_large"); button_02 = editorSkin.GetStyle("button_02"); button_02_large = editorSkin.GetStyle("button_02_large"); button_03 = editorSkin.GetStyle("button_03"); button_03_large = editorSkin.GetStyle("button_03_large"); button_04 = editorSkin.GetStyle("button_04"); button_04_large = editorSkin.GetStyle("button_04_large"); button_05 = editorSkin.GetStyle("button_05"); button_05_large = editorSkin.GetStyle("button_05_large"); helpbox = editorSkin.GetStyle("helpbox"); isInited = true; } else { if (!isLoading) { EditorCoroutines.Execute(TryToInitStyles()); } isLoading = true; } }
public void Init() { settingObject = EditorUtils.GetAsset(type); }