Ejemplo n.º 1
0
        public SpriteVisibilityToolView()
        {
            var columns = new MultiColumnHeaderState.Column[4];

            columns[0] = new MultiColumnHeaderState.Column
            {
                headerContent       = VisibilityTreeViewBase.VisibilityIconStyle.visibilityOnIcon,
                headerTextAlignment = TextAlignment.Center,
                width                 = 32,
                minWidth              = 32,
                maxWidth              = 32,
                autoResize            = false,
                allowToggleVisibility = true
            };
            columns[1] = new MultiColumnHeaderState.Column
            {
                headerContent       = EditorGUIUtility.TrTextContent(TextContent.name),
                headerTextAlignment = TextAlignment.Center,
                width                 = 130,
                minWidth              = 100,
                autoResize            = true,
                allowToggleVisibility = false
            };
            columns[2] = new MultiColumnHeaderState.Column
            {
                headerContent       = EditorGUIUtility.TrTextContent(TextContent.category),
                headerTextAlignment = TextAlignment.Center,
                width                 = 70,
                minWidth              = 50,
                autoResize            = true,
                allowToggleVisibility = false
            };
            columns[3] = new MultiColumnHeaderState.Column
            {
                headerContent       = EditorGUIUtility.TrTextContent(TextContent.label),
                headerTextAlignment = TextAlignment.Center,
                width                 = 50,
                minWidth              = 30,
                autoResize            = true,
                allowToggleVisibility = false
            };
            var multiColumnHeaderState = new MultiColumnHeaderState(columns);
            var multiColumnHeader      = new VisibilityToolColumnHeader(multiColumnHeaderState)
            {
                GetAllVisibility = InternalGetAllVisibility,
                SetAllVisibility = InternalSetAllVisibility,
                canSort          = false,
                height           = 20,
                visibilityColumn = 0
            };

            m_TreeView = new SpriteTreeView(m_TreeViewState, multiColumnHeader)
            {
                GetController = InternalGetController
            };
            SetupSearchField();
        }
        public MeshVisibilityToolView(SkinningCache s)
        {
            skinningCache = s;
            var columns = new MultiColumnHeaderState.Column[2];

            columns[0] = new MultiColumnHeaderState.Column
            {
                headerContent       = new GUIContent(TextContent.name),
                headerTextAlignment = TextAlignment.Center,
                width                 = 200,
                minWidth              = 130,
                autoResize            = true,
                allowToggleVisibility = false
            };
            columns[1] = new MultiColumnHeaderState.Column
            {
                headerContent       = new GUIContent(EditorGUIUtility.FindTexture("visibilityOn")),
                headerTextAlignment = TextAlignment.Center,
                width                 = 32,
                minWidth              = 32,
                maxWidth              = 32,
                autoResize            = false,
                allowToggleVisibility = true
            };
            var multiColumnHeaderState = new MultiColumnHeaderState(columns);
            var multiColumnHeader      = new VisibilityToolColumnHeader(multiColumnHeaderState)
            {
                GetAllVisibility = InternalGetAllVisibility,
                SetAllVisibility = InternalSetAllVisibility,
                canSort          = false,
                height           = 20,
                visibilityColumn = 1
            };

            m_TreeView = new MeshTreeView(m_TreeViewState, multiColumnHeader)
            {
                GetModel = InternalGetModel
            };
            SetupSearchField();
        }