public static void DrawGUI() { using (new GUILayout.HorizontalScope()) { if (GUILayout.Button("Register Class")) { var t = typeof(EditorToolbarClass); P.i.reg = new List <P.Module>(); foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) { foreach (Type type in assembly.GetTypes()) { if (type.GetCustomAttribute(t) == null) { continue; } P.i.reg.Add(new P.Module(assembly.FullName.Split(',')[0], type.FullName)); } } P.Save(); EditorToolbar.MakeMenuCommand(); } if (GUILayout.Button("Unregister Class")) { P.i.reg = new List <P.Module>(); P.Save(); EditorToolbar.MakeMenuCommand(); } } if (P.i.reg != null) { foreach (var p in P.i.reg) { EditorGUILayout.LabelField($"{p.assemblyName} : {p.className}"); } } }
public static void Save() { EditorPrefJson <E> .Set(Package.editorPrefName, i); P.Save(); }