public static int Draw(this IEnumerable <string> current, int index, UnityLabel label = null, GUIStyle style = null, bool indention = true) { style = style ?? EditorStyles.popup; var labelValue = label.IsNull() ? null : label.ToString(); return(EditorUI.Draw <int>(() => EditorGUILayout.Popup(labelValue, index, current.ToArray(), style), indention)); }
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(EditorGUIExtension.Draw <int>(() => EditorGUI.Popup(area, name, index, current.ToArray(), style), indention)); }
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; }
public static Vector4 DrawVector4(this Vector4 current, UnityLabel label = null, bool indention = true) { return(EditorUI.Draw <Vector4>(() => EditorGUILayout.Vector4Field(label.ToString(), current, EditorUI.CreateLayout()), indention)); }
public static Vector4 DrawVector4(this Vector4 current, Rect area, UnityLabel label = null, bool indention = true) { string name = label.IsNull() ? null : label.ToString(); return(EditorGUIExtension.Draw <Vector3>(() => EditorGUI.Vector4Field(area, name, current), indention)); }