Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
        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));
        }
Exemplo n.º 6
0
        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);
        }