Ejemplo n.º 1
0
        public bool CullRow(int row, ITreeViewGUI gui)
        {
            bool result;

            if (!this.isAnimating)
            {
                result = false;
            }
            else
            {
                if (this.printDebug && row == 0)
                {
                    Console.WriteLine("--------");
                }
                if (row > this.m_Setup.startRow && row <= this.m_Setup.endRow)
                {
                    float num = gui.GetRowRect(row, 1f).y - this.m_Setup.startRowRect.y;
                    if (num > this.m_CurrentClipRect.height)
                    {
                        if (this.m_InsideGUIClip)
                        {
                            this.EndClip();
                        }
                        result = true;
                        return(result);
                    }
                }
                result = false;
            }
            return(result);
        }
Ejemplo n.º 2
0
        public void Init(Rect rect, AudioProfilerBackend backend)
        {
            if (this.m_HeaderStyle == null)
            {
                this.m_HeaderStyle = new GUIStyle((GUIStyle)"OL title");
            }
            this.m_HeaderStyle.alignment = TextAnchor.MiddleLeft;
            if (this.m_TreeView != null)
            {
                return;
            }
            this.m_Backend = backend;
            if (this.m_TreeViewState.columnWidths == null)
            {
                int length = AudioProfilerInfoHelper.GetLastColumnIndex() + 1;
                this.m_TreeViewState.columnWidths = new float[length];
                for (int index = 2; index < length; ++index)
                {
                    this.m_TreeViewState.columnWidths[index] = index == 2 || index == 3 || index >= 11 && index <= 16 ? 75f : 60f;
                }
                this.m_TreeViewState.columnWidths[0] = 140f;
                this.m_TreeViewState.columnWidths[1] = 140f;
            }
            this.m_TreeView = new TreeView(this.m_EditorWindow, (TreeViewState)this.m_TreeViewState);
            ITreeViewGUI        gui  = (ITreeViewGUI) new AudioProfilerView.AudioProfilerViewGUI(this.m_TreeView);
            ITreeViewDataSource data = (ITreeViewDataSource) new AudioProfilerView.AudioProfilerDataSource(this.m_TreeView, this.m_Backend);

            this.m_TreeView.Init(rect, data, gui, (ITreeViewDragging)null);
            this.m_ColumnHeader = new AudioProfilerView.AudioProfilerViewColumnHeader(this.m_TreeViewState, this.m_Backend);
            this.m_ColumnHeader.columnWidths          = this.m_TreeViewState.columnWidths;
            this.m_ColumnHeader.minColumnWidth        = 30f;
            this.m_TreeView.selectionChangedCallback += new System.Action <int[]>(this.OnTreeSelectionChanged);
        }
Ejemplo n.º 3
0
 public void Init(Rect rect, ITreeViewDataSource data, ITreeViewGUI gui, ITreeViewDragging dragging)
 {
     this.data        = data;
     this.gui         = gui;
     this.dragging    = dragging;
     this.m_TotalRect = rect;
 }
Ejemplo n.º 4
0
        public void Init(Rect rect, BackendData backendData)
        {
            if (this.m_TreeView != null)
            {
                return;
            }
            this.m_BackendData = backendData;
            TreeViewState treeViewState = new TreeViewState();

            treeViewState.columnWidths = new float[6]
            {
                250f,
                90f,
                93f,
                98f,
                74f,
                78f
            };
            this.m_TreeView = new TreeView(this.m_EditorWindow, treeViewState);
            ITreeViewGUI        gui      = (ITreeViewGUI) new TestGUI(this.m_TreeView);
            ITreeViewDragging   dragging = (ITreeViewDragging) new TestDragging(this.m_TreeView, this.m_BackendData);
            ITreeViewDataSource data     = !this.m_Lazy ? (ITreeViewDataSource) new TestDataSource(this.m_TreeView, this.m_BackendData) : (ITreeViewDataSource) new LazyTestDataSource(this.m_TreeView, this.m_BackendData);

            this.m_TreeView.Init(rect, data, gui, dragging);
            this.m_ColumnHeader = new TreeViewColumnHeader();
            this.m_ColumnHeader.columnWidths    = treeViewState.columnWidths;
            this.m_ColumnHeader.minColumnWidth  = 30f;
            this.m_ColumnHeader.columnRenderer += new System.Action <int, Rect>(this.OnColumnRenderer);
        }
Ejemplo n.º 5
0
 public void Init(Rect rect, ITreeViewDataSource data, ITreeViewGUI gui, ITreeViewDragging dragging)
 {
     this.data     = data;
     this.gui      = gui;
     this.dragging = dragging;
     m_TotalRect   = rect;
     data.OnInitialize();
     gui.OnInitialize();
     if (dragging != null)
     {
         dragging.OnInitialize();
     }
     expandedStateChanged += ExpandedStateHasChanged;
     m_FramingAnimFloat    = new AnimFloat(state.scrollPos.y, AnimatedScrollChanged);
 }
Ejemplo n.º 6
0
 public void Init(Rect rect, ITreeViewDataSource data, ITreeViewGUI gui, ITreeViewDragging dragging)
 {
     this.data        = data;
     this.gui         = gui;
     this.dragging    = dragging;
     this.m_TotalRect = rect;
     data.OnInitialize();
     gui.OnInitialize();
     if (dragging != null)
     {
         dragging.OnInitialize();
     }
     this.expandedStateChanged = (Action)Delegate.Combine(this.expandedStateChanged, new Action(this.ExpandedStateHasChanged));
     this.m_FramingAnimFloat   = new AnimFloat(this.state.scrollPos.y, new UnityAction(this.AnimatedScrollChanged));
 }
 public bool CullRow(int row, ITreeViewGUI gui)
 {
     if (!this.isAnimating)
     {
         return(false);
     }
     if (this.printDebug && row == 0)
     {
         Console.WriteLine("--------");
     }
     if (row <= this.m_Setup.startRow || row > this.m_Setup.endRow || (double)gui.GetRowRect(row, 1f).y - (double)this.m_Setup.startRowRect.y <= (double)this.m_CurrentClipRect.height)
     {
         return(false);
     }
     if (this.m_InsideGUIClip)
     {
         this.EndClip();
     }
     return(true);
 }
Ejemplo n.º 8
0
 public bool CullRow(int row, ITreeViewGUI gui)
 {
     if (this.isAnimating)
     {
         if (this.printDebug && (row == 0))
         {
             Console.WriteLine("--------");
         }
         if ((row > this.m_Setup.startRow) && (row <= this.m_Setup.endRow))
         {
             float num = gui.GetRowRect(row, 1f).y - this.m_Setup.startRowRect.y;
             if (num > this.m_CurrentClipRect.height)
             {
                 if (this.m_InsideGUIClip)
                 {
                     this.EndClip();
                 }
                 return(true);
             }
         }
     }
     return(false);
 }
 public bool CullRow(int row, ITreeViewGUI gui)
 {
     if (this.isAnimating)
     {
         if (this.printDebug && (row == 0))
         {
             Console.WriteLine("--------");
         }
         if ((row > this.m_Setup.startRow) && (row <= this.m_Setup.endRow))
         {
             float num = gui.GetRowRect(row, 1f).y - this.m_Setup.startRowRect.y;
             if (num > this.m_CurrentClipRect.height)
             {
                 if (this.m_InsideGUIClip)
                 {
                     this.EndClip();
                 }
                 return true;
             }
         }
     }
     return false;
 }
Ejemplo n.º 10
0
        // Returns true if row should be culled
        public bool CullRow(int row, ITreeViewGUI gui)
        {
            if (!isAnimating)
            {
                return(false);
            }

            if (printDebug && row == 0)
            {
                Console.WriteLine("--------");
            }

            // Check rows that are inside animation clip rect if they can be culled
            if (row > m_Setup.startRow && row <= m_Setup.endRow)
            {
                Rect rowRect = gui.GetRowRect(row, 1); // we do not care about the width

                // Check row Y local to clipRect
                float rowY = rowRect.y - m_Setup.startRowRect.y;

                if (rowY > m_CurrentClipRect.height)
                {
                    // Ensure to end animation clip since items after
                    // culling should be rendered normally
                    if (m_InsideGUIClip)
                    {
                        EndClip();
                    }

                    return(true);
                }
            }

            // Row is not culled
            return(false);
        }
 public bool CullRow(int row, ITreeViewGUI gui)
 {
   if (!this.isAnimating)
     return false;
   if (this.printDebug && row == 0)
     Console.WriteLine("--------");
   if (row <= this.m_Setup.startRow || row > this.m_Setup.endRow || (double) gui.GetRowRect(row, 1f).y - (double) this.m_Setup.startRowRect.y <= (double) this.m_CurrentClipRect.height)
     return false;
   if (this.m_InsideGUIClip)
     this.EndClip();
   return true;
 }
Ejemplo n.º 12
0
 public void Init(Rect rect, ITreeViewDataSource data, ITreeViewGUI gui, ITreeViewDragging dragging)
 {
   this.data = data;
   this.gui = gui;
   this.dragging = dragging;
   this.m_TotalRect = rect;
   data.OnInitialize();
   gui.OnInitialize();
   if (dragging != null)
     dragging.OnInitialize();
   this.expandedStateChanged += new System.Action(this.ExpandedStateHasChanged);
   this.m_FramingAnimFloat = new AnimFloat(this.state.scrollPos.y, new UnityAction(this.AnimatedScrollChanged));
 }
Ejemplo n.º 13
0
		public void Init(Rect rect, ITreeViewDataSource data, ITreeViewGUI gui, ITreeViewDragging dragging)
		{
			this.data = data;
			this.gui = gui;
			this.dragging = dragging;
			this.m_TotalRect = rect;
		}