Пример #1
0
        void SetupSplitter()
        {
            float[] actualSizes = new float[children.Length];
            float[] minSizes    = new float[children.Length];

            for (int j = 0; j < children.Length; j++)
            {
                View c = (View)children[j];
                actualSizes[j] = GUIUtility.RoundToPixelGrid(vertical ? c.position.height : c.position.width);
                minSizes[j]    = GUIUtility.RoundToPixelGrid(vertical ? c.minSize.y : c.minSize.x);
            }

            splitState           = SplitterState.FromAbsolute(actualSizes, minSizes, null);
            splitState.splitSize = 10;
        }
        void Init()
        {
            if (m_Initialized)
            {
                return;
            }

            if (m_LayoutStripsOnTop == null)
            {
                m_LayoutStripsOnTop = new Layout();
            }

            if (m_LayoutStripsOnTop.m_VerticalSplitter == null || m_LayoutStripsOnTop.m_VerticalSplitter.realSizes.Length != 2)
            {
                m_LayoutStripsOnTop.m_VerticalSplitter = SplitterState.FromAbsolute(new float[] { 65, 35 }, new float[] { 85, 105 }, null);
            }

            if (m_LayoutStripsOnTop.m_HorizontalSplitter == null || m_LayoutStripsOnTop.m_HorizontalSplitter.realSizes.Length != 4)
            {
                m_LayoutStripsOnTop.m_HorizontalSplitter = SplitterState.FromAbsolute(new float[] { 60, 60, 60, 60 }, new float[] { 85, 85, 85, 85 }, null);
            }

            if (m_LayoutStripsOnRight == null)
            {
                m_LayoutStripsOnRight = new Layout();
            }

            if (m_LayoutStripsOnRight.m_HorizontalSplitter == null || m_LayoutStripsOnRight.m_HorizontalSplitter.realSizes.Length != 2)
            {
                m_LayoutStripsOnRight.m_HorizontalSplitter = SplitterState.FromAbsolute(new float[] { 30, 70 }, new float[] { 160, 160 }, null);
            }

            if (m_LayoutStripsOnRight.m_VerticalSplitter == null || m_LayoutStripsOnRight.m_VerticalSplitter.realSizes.Length != 4)
            {
                m_LayoutStripsOnRight.m_VerticalSplitter = SplitterState.FromAbsolute(new float[] { 60, 60, 60, 60 }, new float[] { 100, 85, 85, 85 }, null);
            }

            if (m_AudioGroupTreeState == null)
            {
                m_AudioGroupTreeState = new TreeViewState();
            }
            m_GroupTree = new AudioMixerGroupTreeView(this, m_AudioGroupTreeState);

            if (m_MixersTreeState == null)
            {
                m_MixersTreeState = new TreeViewStateWithAssetUtility();
            }
            m_MixersTree = new AudioMixersTreeView(this, m_MixersTreeState, GetAllControllers);

            if (m_ViewsState == null)
            {
                m_ViewsState = new ReorderableListWithRenameAndScrollView.State();
            }
            m_GroupViews = new AudioMixerGroupViewList(m_ViewsState);

            if (m_SnapshotState == null)
            {
                m_SnapshotState = new ReorderableListWithRenameAndScrollView.State();
            }
            m_SnapshotListView = new AudioMixerSnapshotListView(m_SnapshotState);

            if (m_ChannelStripViewState == null)
            {
                m_ChannelStripViewState = new AudioMixerChannelStripView.State();
            }
            m_ChannelStripView = new AudioMixerChannelStripView(m_ChannelStripViewState);

            OnMixerControllerChanged();

            m_Initialized = true;
        }