Пример #1
0
 public static Vector4 DrawVector4(this Vector4 current, UnityLabel label = null, bool indention = true)
 {
     return(EditorGUIExtension.Draw <Vector4>(() => EditorGUILayout.Vector4Field(label.ToString(), current, Class.CreateLayout()), indention));
 }
Пример #2
0
        public static void Draw(this SerializedProperty current, UnityLabel label = null, bool allowScene = true, bool indention = true)
        {
            if (label != null && label.value.text.IsEmpty())
            {
                label = new GUIContent(current.displayName);
            }
            Action action = () => EditorGUILayout.PropertyField(current, label, allowScene, Class.CreateLayout());

            EditorGUIExtension.Draw(action, indention);
        }
Пример #3
0
 public static Type Draw <Type>(this UnityObject current, UnityLabel label = null, bool allowScene = true, bool indention = true) where Type : UnityObject
 {
     return((Type)EditorGUIExtension.Draw <UnityObject>(() => EditorGUILayout.ObjectField(label, current, typeof(Type), allowScene, Class.CreateLayout()), indention));
 }
Пример #4
0
 public static Vector3 DrawVector3(this Vector3 current, UnityLabel label = null, bool indention = true)
 {
     return(EditorGUIExtension.Draw <Vector3>(() => EditorGUILayout.Vector3Field(label, current, Class.CreateLayout()), indention));
 }
Пример #5
0
 public static bool DrawButton(this UnityLabel current, GUIStyle style = null, bool indention = true)
 {
     style = style ?? GUI.skin.button;
     return(EditorGUIExtension.Draw <bool>(() => GUILayout.Button(current, style, Class.CreateLayout()), indention));
 }
Пример #6
0
 public static float DrawSlider(this float current, float min, float max, UnityLabel label = null, bool indention = true)
 {
     return(EditorGUIExtension.Draw <float>(() => EditorGUILayout.Slider(label, current, min, max, Class.CreateLayout()), indention));
 }
Пример #7
0
 public static string DrawTextArea(this string current, UnityLabel label = null, GUIStyle style = null, bool indention = true)
 {
     style = style ?? EditorStyles.textField;
     return(EditorGUIExtension.Draw <string>(() => EditorGUILayout.TextField(label, current, style, Class.CreateLayout()), indention));
 }
Пример #8
0
        public static void Draw(this IDictionary current, UnityLabel label = null, GUIStyle style = null, bool indention = true)
        {
            var open = EditorGUILayoutExtensionSpecial.DrawFoldout(label.ToString().ToTitleCase(), Class.CreateLayout());

            if (!open)
            {
                return;
            }
            EditorGUI.indentLevel += 1;
            foreach (DictionaryEntry item in current)
            {
                item.Value.DrawAuto(item.Key.ToString(), style, true);
            }
            EditorGUI.indentLevel -= 1;
        }
Пример #9
0
 public static Color Draw(this Color current, UnityLabel label = null, bool indention = true)
 {
     return(EditorGUIExtension.Draw <Color>(() => EditorGUILayout.ColorField(label, current, Class.CreateLayout()), indention));
 }
Пример #10
0
 public static AnimationCurve Draw(this AnimationCurve current, UnityLabel label = null, bool indention = true)
 {
     return(EditorGUIExtension.Draw <AnimationCurve>(() => EditorGUILayout.CurveField(label, current, Class.CreateLayout()), indention));
 }
Пример #11
0
 public static Rect Draw(this Rect current, UnityLabel label = null, bool indention = true)
 {
     return(EditorGUIExtension.Draw <Rect>(() => EditorGUILayout.RectField(label, current, Class.CreateLayout()), indention));
 }