Example #1
0
        /// <summary>
        ///
        /// </summary>
        private static void DrawGUI()
        {
            using (new PreferenceLayoutScope())
            {
                EditorGUI.BeginChangeCheck();
                Pref.i.enableProjectSettingsProvider = HEditorGUILayout.ToggleLeft(S._ProjectSettingsProvider, Pref.i.enableProjectSettingsProvider);
                Pref.i.iconOpenCSProject             = HEditorGUILayout.GUIDObjectField <Texture2D>(nameof(Pref.i.iconOpenCSProject).nicify(), Pref.i.iconOpenCSProject);

                if (EditorGUI.EndChangeCheck())
                {
                    EditorToolbar.s_styles.LoadProjectIcon();
                    EditorToolbar.Repaint();
                    Pref.Save();
                }

                if (Pref.i.enableProjectSettingsProvider)
                {
                    return;
                }

                GUILayout.Space(8f);

                GUILayout.Label(S._ProjectSettings, "ShurikenModuleTitle");
#if UNITY_2018_3_OR_NEWER
                EditorToolbarSettingsProvider.DrawGUI();
#endif
            }
        }
 public static void DrawGUI()
 {
     using (new GUILayout.HorizontalScope())
     {
         if (GUILayout.Button("Register Class"))
         {
             var t = typeof(EditorToolbarClass);
             Settings.i.reg = new List <Settings.Module>();
             foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
             {
                 foreach (Type type in assembly.GetTypes())
                 {
                     if (type.GetCustomAttribute(t) == null)
                     {
                         continue;
                     }
                     Settings.i.reg.Add(new Settings.Module(assembly.FullName.Split(',')[0], type.FullName));
                 }
             }
             Settings.Save();
             EditorToolbar.MakeMenuCommand();
         }
         if (GUILayout.Button("Unregister Class"))
         {
             Settings.i.reg = new List <Settings.Module>();
             Settings.Save();
             EditorToolbar.MakeMenuCommand();
         }
     }
     if (Settings.i.reg != null)
     {
         foreach (var p in Settings.i.reg)
         {
             UnityEditor.EditorGUILayout.LabelField($"{p.assemblyName} : {p.className}");
         }
     }
 }