A game about forced loneliness, made by TACStudios
at master 1.3 kB view raw
1using System.Collections.Generic; 2 3using UnityEditor.IMGUI.Controls; 4using UnityEngine; 5 6namespace Unity.PlasticSCM.Editor.UI.Tree 7{ 8 internal class PlasticTreeView : TreeView 9 { 10 internal PlasticTreeView() : base(new TreeViewState()) 11 { 12 rowHeight = UnityConstants.TREEVIEW_ROW_HEIGHT; 13 treeViewRect = new Rect(0, 0, 0, rowHeight); 14 showAlternatingRowBackgrounds = false; 15 } 16 17 public override IList<TreeViewItem> GetRows() 18 { 19 return mRows; 20 } 21 22 protected override TreeViewItem BuildRoot() 23 { 24 return new TreeViewItem(0, -1, string.Empty); 25 } 26 27 protected override void BeforeRowsGUI() 28 { 29 int firstRowVisible; 30 int lastRowVisible; 31 GetFirstAndLastVisibleRows(out firstRowVisible, out lastRowVisible); 32 33 GUI.DrawTexture(new Rect(0, 34 firstRowVisible * rowHeight, 35 GetRowRect(0).width + 1000, 36 (lastRowVisible * rowHeight) + 1000), 37 Images.GetTreeviewBackgroundTexture()); 38 39 DrawTreeViewItem.InitializeStyles(); 40 base.BeforeRowsGUI(); 41 } 42 43 protected List<TreeViewItem> mRows = new List<TreeViewItem>(); 44 } 45}