public static void Draw(this SerializedProperty current, Rect area, UnityLabel label = null, bool allowScene = true, bool indention = true) { if (label != null && label.value.text.IsEmpty()) { label = new GUIContent(current.displayName); } EditorUI.Draw(() => EditorGUI.PropertyField(area, current, label, allowScene), indention, area); }
public static Enum DrawMaskField(this Enum current, Rect area, UnityLabel label = null, GUIStyle style = null, bool indention = true) { style = style ?? EditorStyles.popup; #if UNITY_2017_3_OR_NEWER return(EditorUI.Draw <Enum>(() => EditorGUI.EnumFlagsField(area, label, current, style), indention, area)); #else return(EditorUI.Draw <Enum>(() => EditorGUI.EnumMaskField(area, label, current, style), indention, area)); #endif }
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, EditorUI.CreateLayout()); EditorUI.Draw(action, indention); }
public static Enum DrawFlags(this Enum current, UnityLabel label = null, GUIStyle style = null, bool indention = true) { style = style ?? EditorStyles.popup; var layout = style.CreateLayout() ?? EditorUI.CreateLayout(); #if UNITY_2017_3_OR_NEWER return(EditorUI.Draw(() => EditorGUILayout.EnumFlagsField(label, current, style, layout), indention)); #else return(EditorUI.Draw(() => EditorGUILayout.EnumMaskField(label, current, style, layout), indention)); #endif }
public static void DrawLabel(this UnityLabel current, GUIStyle style = null, bool indention = true) { style = style ?? EditorStyles.label; var layout = style.CreateLayout() ?? EditorUI.CreateLayout(); if (indention) { EditorUI.Draw(() => EditorGUILayout.LabelField(current, style, layout), indention); return; } EditorUI.Draw(() => GUILayout.Label(current, style, layout), indention); }
public static float DrawSlider(this float current, float min, float max, UnityLabel label = null, bool indention = true) { return(EditorUI.Draw(() => EditorGUILayout.Slider(label, current, min, max, EditorUI.CreateLayout()), indention)); }
public static Enum Draw(this Enum current, Rect area, UnityLabel label = null, GUIStyle style = null, bool indention = true) { style = style ?? EditorStyles.popup; return(EditorUI.Draw <Enum>(() => EditorGUI.EnumPopup(area, label, current, style), indention, area)); }
public static int Draw(this IEnumerable <string> current, Rect area, int index, UnityLabel label = null, GUIStyle style = null, bool indention = true) { style = style ?? EditorStyles.popup; string name = label.IsNull() ? "" : label.ToString(); return(EditorUI.Draw <int>(() => EditorGUI.Popup(area, name, index, current.ToArray(), style), indention, area)); }
public static float Draw(this float current, Rect area, UnityLabel label = null, GUIStyle style = null, bool indention = true) { style = style ?? EditorStyles.numberField; return(EditorUI.Draw <float>(() => EditorGUI.FloatField(area, label, current, style), indention, area)); }
public static bool Draw(this bool current, Rect area, UnityLabel label = null, GUIStyle style = null, bool indention = true) { style = style ?? EditorStyles.toggle; return(EditorUI.Draw <bool>(() => EditorGUI.Toggle(area, label, current, style), indention, area)); }
public static Vector4 DrawVector4(this Vector4 current, UnityLabel label = null, bool indention = true) { return(EditorUI.Draw(() => EditorGUILayout.Vector4Field(label.ToString(), current, EditorUI.CreateLayout()), indention)); }
public static string Draw(this string current, Rect area, UnityLabel label = null, GUIStyle style = null, bool indention = true) { style = style ?? EditorStyles.textField; return(EditorUI.Draw <string>(() => EditorGUI.TextField(area, label, current, style), indention, area)); }
public static void DrawPrefix(this UnityLabel current, GUIStyle style = null, GUIStyle followStyle = null, bool indention = true) { style = style ?? EditorStyles.label; followStyle = followStyle ?? GUI.skin.button; EditorUI.Draw(() => EditorGUILayout.PrefixLabel(current, followStyle, style), indention); }
public static Vector4 DrawVector4(this Vector4 current, Rect area, UnityLabel label = null, bool indention = true) { string name = label.IsNull() ? null : label.ToString(); return(EditorUI.Draw <Vector3>(() => EditorGUI.Vector4Field(area, name, current), indention, area)); }
public static bool DrawButton(this UnityLabel current, Rect area, GUIStyle style = null, bool indention = true) { style = style ?? GUI.skin.button; return(EditorUI.Draw <bool>(() => GUI.Button(area, current, style), indention, area)); }
public static Color Draw(this Color current, Rect area, UnityLabel label = null, bool indention = true) { return(EditorUI.Draw <Color>(() => EditorGUI.ColorField(area, label, current), indention, area)); }
public static Color Draw(this Color current, UnityLabel label = null, bool indention = true) { return(EditorUI.Draw(() => EditorGUILayout.ColorField(label, current, EditorUI.CreateLayout()), indention)); }
public static AnimationCurve Draw(this AnimationCurve current, UnityLabel label = null, bool indention = true) { return(EditorUI.Draw(() => EditorGUILayout.CurveField(label, current, EditorUI.CreateLayout()), indention)); }
public static Type Draw <Type>(this UnityObject current, UnityLabel label = null, bool allowScene = true, bool indention = true) where Type : UnityObject { return((Type)EditorUI.Draw(() => EditorGUILayout.ObjectField(label, current, typeof(Type), allowScene, EditorUI.CreateLayout()), indention)); }
public static Rect Draw(this Rect current, Rect area, UnityLabel label = null, bool indention = true) { return(EditorUI.Draw <Rect>(() => EditorGUI.RectField(area, label, current), indention, area)); }
public static Type Draw <Type>(this UnityObject current, Rect area, UnityLabel label = null, bool allowScene = true, bool indention = true) where Type : UnityObject { return((Type)EditorUI.Draw <UnityObject>(() => EditorGUI.ObjectField(area, label, current, typeof(Type), allowScene), indention, area)); }
public static AnimationCurve Draw(this AnimationCurve current, Rect area, UnityLabel label = null, bool indention = true) { return(EditorUI.Draw <AnimationCurve>(() => EditorGUI.CurveField(area, label, current), indention, area)); }
public static IEnumerable <bool> DrawFlags(this IEnumerable <string> current, IEnumerable <bool> active, UnityLabel label = null, GUIStyle style = null, bool indention = true) { style = style ?? EditorStyles.popup; var layout = style.CreateLayout() ?? EditorUI.CreateLayout(); var mask = EditorUI.Draw(() => EditorGUILayout.MaskField(label, active.ToBitFlags(), current.ToArray(), style, layout), indention); return(mask.ToFlags(active.Count())); }
public static void DrawLabel(this UnityLabel current, Rect area, GUIStyle style = null, bool indention = true) { style = style ?? EditorStyles.label; EditorUI.Draw(() => EditorGUI.LabelField(area, current, style), indention, area); }
public static Vector3 DrawVector3(this Vector3 current, Rect area, UnityLabel label = null, bool indention = true) { return(EditorUI.Draw <Vector3>(() => EditorGUI.Vector3Field(area, label, current), indention, area)); }