Ejemplo n.º 1
0
        public void ScrollView(string id, LayoutDelegate fadeFunc, params GUILayoutOption[] options)
        {
            Vector2 scroll = TryGetScrollStack(id);

            scroll = ExGUI.ScrollView(scroll, fadeFunc, options);
            RecordScrollValue(id, scroll);
        }
Ejemplo n.º 2
0
        public void FoldoutGroupIndent(string id, string title, bool autoOpen, LayoutDelegate layoutFunc)
        {
            bool open = TryGetFadeStack(id, autoOpen);

            ExGUI.FoldoutGroupIndent(ref open, title, layoutFunc);
            RecordValue(id, open);
        }
Ejemplo n.º 3
0
 public static void Group(string title, bool space, GUIStyle style, LayoutDelegate layoutFunc)
 {
     Vertical(style, delegate
     {
         Group(title, space, layoutFunc);
     });
 }
Ejemplo n.º 4
0
        public void FoldoutGroup(string title, bool autoOpen, LayoutDelegate layoutFunc, LayoutDelegate headerLayoutFunc)
        {
            bool open = TryGetFadeStack(title, autoOpen);

            ExGUI.FoldoutGroup(ref open, title, layoutFunc, headerLayoutFunc);
            RecordValue(title, open);
        }
Ejemplo n.º 5
0
        public static void FoldoutGroup(ref bool foldoutValue, string title, LayoutDelegate layoutFunc, LayoutDelegate headerLayoutFunc)
        {
            Color cachedColor = GUI.color;

            GUI.color = new Color(cachedColor.r, cachedColor.g, cachedColor.b, 0.5f);
            EditorGUILayout.BeginHorizontal(ExStyles.MenuItemToolbarStyle);
            GUI.color = cachedColor;

            bool value = GUILayout.Toggle(foldoutValue, title, ExStyles.MenuItemToggleStyle);

            if (Event.current.button == ExStyles.FoldoutMouseId)
            {
                foldoutValue = value;
            }
            headerLayoutFunc();
            EditorGUILayout.EndHorizontal();

            if (foldoutValue)
            {
                cachedColor = GUI.color;
                GUI.color   = new Color(cachedColor.r, cachedColor.g, cachedColor.b, (EditorGUIUtility.isProSkin ? 0.5f : 0.25f));
                EditorGUILayout.BeginVertical(ExStyles.MenuItemBackgroundStyle);
                {
                    GUI.color = cachedColor;
                    EditorGUI.indentLevel++;
                    layoutFunc();
                    EditorGUI.indentLevel--;
                    EditorGUILayout.Separator();
                }
                EditorGUILayout.EndVertical();
            }
        }
Ejemplo n.º 6
0
        public static Vector2 ScrollView(Vector2 scrollPosition, LayoutDelegate layoutFunc, params GUILayoutOption[] options)
        {
            Vector2 d = UnityEditor.EditorGUILayout.BeginScrollView(scrollPosition, options);

            layoutFunc();
            UnityEditor.EditorGUILayout.EndScrollView();
            return(d);
        }
Ejemplo n.º 7
0
 public static void Group(string title, bool space, LayoutDelegate layoutFunc)
 {
     Title(title);
     layoutFunc();
     if (space)
     {
         UnityEditor.EditorGUILayout.Space();
     }
 }
Ejemplo n.º 8
0
 public static void Horizontal(bool styled, LayoutDelegate layoutFunc, params GUILayoutOption[] options)
 {
     if (styled)
     {
         Horizontal(UnityEditor.EditorStyles.helpBox, layoutFunc, options);
         return;
     }
     Horizontal(layoutFunc, options);
 }
Ejemplo n.º 9
0
 public static void Group(LayoutDelegate headerDraw, LayoutDelegate contentDraw)
 {
     if (headerDraw != null)
     {
         headerDraw();
     }
     if (contentDraw != null)
     {
         contentDraw();
     }
 }
Ejemplo n.º 10
0
 public static void Group(GUIStyle style, LayoutDelegate headerDraw, LayoutDelegate layoutFunc)
 {
     if (style == null)
     {
         EditorGUILayout.BeginVertical();
     }
     else
     {
         EditorGUILayout.BeginVertical(style);
     }
     Group(headerDraw, layoutFunc);
     EditorGUILayout.EndVertical();
 }
Ejemplo n.º 11
0
        public static void FoldoutGroup(string title, LayoutDelegate layoutFunc)
        {
            Color cachedColor = GUI.color;

            GUI.color = new Color(cachedColor.r, cachedColor.g, cachedColor.b, 0.5f);
            EditorGUILayout.BeginHorizontal(ExStyles.MenuItemToolbarStyle);
            GUI.color = cachedColor;

            GUILayout.Label(title, ExStyles.MenuItemToggleStyle);

            EditorGUILayout.EndHorizontal();


            cachedColor = GUI.color;
            GUI.color   = new Color(cachedColor.r, cachedColor.g, cachedColor.b, (EditorGUIUtility.isProSkin ? 0.5f : 0.25f));
            EditorGUILayout.BeginVertical(ExStyles.MenuItemBackgroundStyle);
            GUI.color = cachedColor;

            EditorGUI.indentLevel++;
            layoutFunc();
            EditorGUI.indentLevel--;
            EditorGUILayout.Separator();
            EditorGUILayout.EndVertical();
        }
Ejemplo n.º 12
0
 public static void Vertical(GUIStyle style, LayoutDelegate layoutFunc, params GUILayoutOption[] options)
 {
     UnityEditor.EditorGUILayout.BeginVertical(style, options);
     layoutFunc();
     UnityEditor.EditorGUILayout.EndVertical();
 }
Ejemplo n.º 13
0
 public static void Horizontal(LayoutDelegate layoutFunc, params GUILayoutOption[] options)
 {
     UnityEditor.EditorGUILayout.BeginHorizontal(options);
     layoutFunc();
     UnityEditor.EditorGUILayout.EndHorizontal();
 }
Ejemplo n.º 14
0
 public static void Indent(LayoutDelegate layoutFunc)
 {
     UnityEditor.EditorGUI.indentLevel = UnityEditor.EditorGUI.indentLevel + 1;
     layoutFunc();
     UnityEditor.EditorGUI.indentLevel = UnityEditor.EditorGUI.indentLevel - 1;
 }
Ejemplo n.º 15
0
        public static Vector2 ScrollView(Vector2 scrollPosition, bool alwaysShowHorizontal, bool alwaysShowVertical, GUIStyle horizontalScrollbar, GUIStyle verticalScrollbar, GUIStyle background, LayoutDelegate layoutFunc, params GUILayoutOption[] options)
        {
            Vector2 d = UnityEditor.EditorGUILayout.BeginScrollView(scrollPosition, alwaysShowHorizontal, alwaysShowVertical, horizontalScrollbar, verticalScrollbar, background, options);

            layoutFunc();
            UnityEditor.EditorGUILayout.EndScrollView();
            return(d);
        }
Ejemplo n.º 16
0
        //
        //
        //



        public static Vector2 ScrollView(Vector2 scrollPosition, GUIStyle horizontalScrollbar, GUIStyle verticalScrollbar, LayoutDelegate layoutFunc, params GUILayoutOption[] options)
        {
            Vector2 d = UnityEditor.EditorGUILayout.BeginScrollView(scrollPosition, horizontalScrollbar, verticalScrollbar, options);

            layoutFunc();
            UnityEditor.EditorGUILayout.EndScrollView();
            return(d);
        }
Ejemplo n.º 17
0
        public void ScrollView(string id, bool alwaysShowHorizontal, bool alwaysShowVertical, LayoutDelegate fadeFunc, params GUILayoutOption[] options)
        {
            Vector2 scroll = TryGetScrollStack(id);

            scroll = ExGUI.ScrollView(scroll, alwaysShowHorizontal, alwaysShowHorizontal, fadeFunc, options);
            RecordScrollValue(id, scroll);
        }
Ejemplo n.º 18
0
 public static void Group(string title, LayoutDelegate layoutFunc)
 {
     Title(title);
     layoutFunc();
 }