public static void DrawLabel(this UnityLabel current, UnityLabel label, GUIStyle style = null, bool indention = true) { style = style ?? EditorStyles.label; var layout = style.CreateLayout() ?? EditorUI.CreateLayout(); EditorUI.Draw(() => EditorGUILayout.LabelField(label, current, style, layout), indention); }
public static Enum Draw(this Enum current, UnityLabel label = null, GUIStyle style = null, bool indention = true) { style = style ?? EditorStyles.popup; var layout = style.CreateLayout() ?? EditorUI.CreateLayout(); return(EditorUI.Draw(() => EditorGUILayout.EnumPopup(label, current, style, layout), indention)); }
public static float Draw(this float current, UnityLabel label = null, GUIStyle style = null, bool indention = true) { style = style ?? EditorStyles.numberField; var layout = style.CreateLayout() ?? EditorUI.CreateLayout(); return(EditorUI.Draw(() => EditorGUILayout.FloatField(label, current, style, layout), indention)); }
public static bool Draw(this bool current, UnityLabel label = null, GUIStyle style = null, bool indention = true) { style = style ?? EditorStyles.toggle; var layout = style.CreateLayout() ?? EditorUI.CreateLayout(); return(EditorUI.Draw(() => EditorGUILayout.Toggle(label, current, style, layout), indention)); }
public static bool DrawButton(this UnityLabel current, GUIStyle style = null, bool indention = true) { style = style ?? GUI.skin.button; var layout = style.CreateLayout() ?? EditorUI.CreateLayout(); return(EditorUI.Draw(() => GUILayout.Button(current, style, layout), indention)); }
public static string DrawTextArea(this string current, UnityLabel label = null, GUIStyle style = null, bool indention = true) { style = style ?? EditorStyles.textField; var layout = style.CreateLayout() ?? EditorUI.CreateLayout(); return(EditorUI.Draw(() => EditorGUILayout.TextField(label, current, style, layout), indention)); }
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 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 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 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 Vector4 DrawVector4(this Vector4 current, UnityLabel label = null, bool indention = true) { return(EditorUI.Draw(() => EditorGUILayout.Vector4Field(label.ToString(), 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 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)); }