Пример #1
0
        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);
            }
        }
Пример #2
0
 /// <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);
 }
Пример #3
0
 /// <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);
 }
Пример #4
0
 public static void ContextCreateEditor(MenuCommand cmd)
 {
     JiffyEditor.CreateEditor(cmd.context as MonoScript, GeneratorTypes.CustomEditor);
 }