public static void MenuCreatePropertyDrawer() { //Try to grab the first instance of Monoscript in our selection var script = Selection.objects.FirstOrDefault <Object>(t => { return(t.GetType() == typeof(MonoScript)); }) as MonoScript; if (script != null) { JiffyEditor.CreateEditor(script, GeneratorTypes.PropertyDrawer); } else { EditorGUIUtilityEx.ShowTypeSerachWindow(OnTypeForProperyDrawerSelected, GeneratorTypes.PropertyDrawer); } }
/// <summary> /// This is the callback used my the Type Select Window used for creating a custom Property Drawer. /// </summary> private static void OnTypeForProperyDrawerSelected(System.Type type) { JiffyEditor.CreateEditor(type, GeneratorTypes.PropertyDrawer); }
/// <summary> /// This is the callback used my the Type Select Window used for creating a Custom Editor. /// </summary> private static void OnTypeForEditorSelected(System.Type type) { JiffyEditor.CreateEditor(type, GeneratorTypes.CustomEditor); }
public static void ContextCreateEditor(MenuCommand cmd) { JiffyEditor.CreateEditor(cmd.context as MonoScript, GeneratorTypes.CustomEditor); }