Esempio n. 1
0
        private void DoStickySceneHeaders()
        {
            int firstRowVisible;
            int lastRowVisible;

            this.GetFirstAndLastRowVisible(out firstRowVisible, out lastRowVisible);
            if (firstRowVisible < 0 || lastRowVisible < 0)
            {
                return;
            }
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            GameObjectTreeViewGUI.\u003CDoStickySceneHeaders\u003Ec__AnonStorey79 headersCAnonStorey79 = new GameObjectTreeViewGUI.\u003CDoStickySceneHeaders\u003Ec__AnonStorey79();
            float y = this.m_TreeView.state.scrollPos.y;

            if (firstRowVisible == 0 && (double)y <= (double)this.topRowMargin)
            {
                return;
            }
            // ISSUE: reference to a compiler-generated field
            headersCAnonStorey79.firstItem = (GameObjectTreeViewItem)this.m_TreeView.data.GetItem(firstRowVisible);
            GameObjectTreeViewItem objectTreeViewItem = (GameObjectTreeViewItem)this.m_TreeView.data.GetItem(firstRowVisible + 1);
            // ISSUE: reference to a compiler-generated field
            bool  flag    = headersCAnonStorey79.firstItem.scene != objectTreeViewItem.scene;
            float width   = GUIClip.visibleRect.width;
            Rect  rowRect = this.GetRowRect(firstRowVisible, width);

            // ISSUE: reference to a compiler-generated field
            if (headersCAnonStorey79.firstItem.isSceneHeader && Mathf.Approximately(y, rowRect.y))
            {
                return;
            }
            if (!flag)
            {
                rowRect.y = y;
            }
            // ISSUE: reference to a compiler-generated method
            GameObjectTreeViewItem sceneHeaderItem = ((GameObjectTreeViewDataSource)this.m_TreeView.data).sceneHeaderItems.FirstOrDefault <GameObjectTreeViewItem>(new Func <GameObjectTreeViewItem, bool>(headersCAnonStorey79.\u003C\u003Em__117));

            if (sceneHeaderItem == null)
            {
                return;
            }
            bool selected    = this.m_TreeView.IsItemDragSelectedOrSelected((TreeViewItem)sceneHeaderItem);
            bool focused     = this.m_TreeView.HasFocus();
            bool useBoldFont = sceneHeaderItem.scene == SceneManager.GetActiveScene();

            this.DoNodeGUI(rowRect, firstRowVisible, (TreeViewItem)sceneHeaderItem, selected, focused, useBoldFont);
            if (GUI.Button(new Rect(rowRect.x, rowRect.y, rowRect.height, rowRect.height), GUIContent.none, GUIStyle.none))
            {
                this.m_TreeView.Frame(sceneHeaderItem.id, true, false);
            }
            this.m_TreeView.HandleUnusedMouseEventsForNode(rowRect, (TreeViewItem)sceneHeaderItem, false);
            this.HandleStickyHeaderContextClick(rowRect, sceneHeaderItem);
        }
 private void DoStickySceneHeaders()
 {
   int firstRowVisible;
   int lastRowVisible;
   this.GetFirstAndLastRowVisible(out firstRowVisible, out lastRowVisible);
   if (firstRowVisible < 0 || lastRowVisible < 0)
     return;
   // ISSUE: object of a compiler-generated type is created
   // ISSUE: variable of a compiler-generated type
   GameObjectTreeViewGUI.\u003CDoStickySceneHeaders\u003Ec__AnonStorey79 headersCAnonStorey79 = new GameObjectTreeViewGUI.\u003CDoStickySceneHeaders\u003Ec__AnonStorey79();
   float y = this.m_TreeView.state.scrollPos.y;
   if (firstRowVisible == 0 && (double) y <= (double) this.topRowMargin)
     return;
   // ISSUE: reference to a compiler-generated field
   headersCAnonStorey79.firstItem = (GameObjectTreeViewItem) this.m_TreeView.data.GetItem(firstRowVisible);
   GameObjectTreeViewItem objectTreeViewItem = (GameObjectTreeViewItem) this.m_TreeView.data.GetItem(firstRowVisible + 1);
   // ISSUE: reference to a compiler-generated field
   bool flag = headersCAnonStorey79.firstItem.scene != objectTreeViewItem.scene;
   float width = GUIClip.visibleRect.width;
   Rect rowRect = this.GetRowRect(firstRowVisible, width);
   // ISSUE: reference to a compiler-generated field
   if (headersCAnonStorey79.firstItem.isSceneHeader && Mathf.Approximately(y, rowRect.y))
     return;
   if (!flag)
     rowRect.y = y;
   // ISSUE: reference to a compiler-generated method
   GameObjectTreeViewItem sceneHeaderItem = ((GameObjectTreeViewDataSource) this.m_TreeView.data).sceneHeaderItems.FirstOrDefault<GameObjectTreeViewItem>(new Func<GameObjectTreeViewItem, bool>(headersCAnonStorey79.\u003C\u003Em__117));
   if (sceneHeaderItem == null)
     return;
   bool selected = this.m_TreeView.IsItemDragSelectedOrSelected((TreeViewItem) sceneHeaderItem);
   bool focused = this.m_TreeView.HasFocus();
   bool useBoldFont = sceneHeaderItem.scene == SceneManager.GetActiveScene();
   this.DoNodeGUI(rowRect, firstRowVisible, (TreeViewItem) sceneHeaderItem, selected, focused, useBoldFont);
   if (GUI.Button(new Rect(rowRect.x, rowRect.y, rowRect.height, rowRect.height), GUIContent.none, GUIStyle.none))
     this.m_TreeView.Frame(sceneHeaderItem.id, true, false);
   this.m_TreeView.HandleUnusedMouseEventsForNode(rowRect, (TreeViewItem) sceneHeaderItem, false);
   this.HandleStickyHeaderContextClick(rowRect, sceneHeaderItem);
 }