public static Enum Draw(this Enum current, UnityLabel label = null, GUIStyle style = null, bool indention = true) { style = style ?? EditorStyles.popup; var layout = style.CreateLayout() ?? Class.CreateLayout(); return(EditorUI.Draw <Enum>(() => EditorGUILayout.EnumPopup(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() ?? Class.CreateLayout(); return(EditorUI.Draw <bool>(() => EditorGUILayout.Toggle(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() ?? Class.CreateLayout(); return(EditorUI.Draw <float>(() => EditorGUILayout.FloatField(label, current, style, layout), indention)); }
public static string Draw(this string current, UnityLabel label = null, GUIStyle style = null, bool indention = true) { style = style ?? EditorStyles.textField; var layout = style.CreateLayout() ?? Class.CreateLayout(); return(EditorUI.Draw <string>(() => EditorGUILayout.TextField(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() ?? Class.CreateLayout(); return(EditorUI.Draw <bool>(() => GUILayout.Button(current, style, layout), indention)); }
public static void DrawLabel(this UnityLabel current, GUIStyle style = null, bool indention = true) { style = style ?? EditorStyles.label; var layout = style.CreateLayout() ?? Class.CreateLayout(); if (indention) { EditorUI.Draw(() => EditorGUILayout.LabelField(current, style, layout), indention); return; } EditorUI.Draw(() => GUILayout.Label(current, style, layout), indention); }