public static void FoldAll(MenuCommand command)
        {
            ActiveEditorTracker editorTracker = ActiveEditorTracker.sharedTracker;

            Editor[] editors = editorTracker.activeEditors;

            bool areAllFolded = true;

            for (int i = 1; i < editors.Length; i++)
            {
                if (editorTracker.GetVisible(i) > 0)
                {
                    areAllFolded = false;
                }
            }

            for (int i = 1; i < editors.Length; i++)
            {
                if (editorTracker.GetVisible(i) < 0)
                {
                    continue;
                }

                editorTracker.SetVisible(i, areAllFolded ? 1 : 0);
                InternalEditorUtility.SetIsInspectorExpanded(editors[i].target, areAllFolded);
            }
        }
Exemplo n.º 2
0
    public static void FoldAll(MenuCommand command)
    {
        ActiveEditorTracker editorTracker = ActiveEditorTracker.sharedTracker;

        Editor[] editors = editorTracker.activeEditors;

        bool areAllFolded = true;

        for (int i = 1; i < editors.Length; i++)
        {
            int getVisible = editorTracker.GetVisible(i);

            Editor edit   = editors[i];
            string name   = edit.name;
            string target = edit.target.name;
            Type   type   = edit.target.GetType();

            if (editorTracker.GetVisible(i) != 0)
            {
                areAllFolded = false;
                break;
            }
        }

        for (int i = 1; i < editors.Length; i++)
        {
            editorTracker.SetVisible(i, areAllFolded ? 1 : 0);
        }
    }
Exemplo n.º 3
0
        public static void FoldAll(MenuCommand command)
        {
            ActiveEditorTracker editorTracker = ActiveEditorTracker.sharedTracker;

            Editor[] editors = editorTracker.activeEditors;

            bool areAllFolded = true;

            for (int i = 1; i < editors.Length; i++)
            {
                if (editorTracker.GetVisible(i) != 0)
                {
                    areAllFolded = false;
                    break;
                }
            }

            for (int i = 1; i < editors.Length; i++)
            {
                editorTracker.SetVisible(i, areAllFolded ? 1 : 0);
            }
        }