GenerateRect() protected static method

protected static GenerateRect ( int row ) : Rect
row int
return UnityEngine.Rect
Example #1
0
        protected virtual void DrawItem(MemoryElement memoryElement, ref int row, int indent)
        {
            bool flag = this.m_MemorySelection.isSelected(memoryElement);

            MemoryTreeList.DrawBackground(row, flag);
            Rect rect = MemoryTreeList.GenerateRect(row);

            rect.x = 4f + (float)indent * 16f - 14f;
            Rect position = rect;

            position.width = 14f;
            if (memoryElement.ChildCount() > 0)
            {
                memoryElement.expanded = GUI.Toggle(position, memoryElement.expanded, GUIContent.none, MemoryTreeList.styles.foldout);
            }
            rect.x += 14f;
            if (flag)
            {
                this.m_SelectionOffset = (float)row * 16f;
            }
            if (Event.current.type == EventType.MouseDown && rect.Contains(Event.current.mousePosition))
            {
                this.RowClicked(Event.current, memoryElement);
            }
            this.DrawData(rect, memoryElement, indent, row, flag);
            if (memoryElement.expanded)
            {
                this.DrawRecursiveData(memoryElement, ref row, indent + 1);
            }
        }
Example #2
0
        protected static void DrawBackground(int row, bool selected)
        {
            Rect     position = MemoryTreeList.GenerateRect(row);
            GUIStyle gUIStyle = (row % 2 != 0) ? MemoryTreeList.styles.entryOdd : MemoryTreeList.styles.entryEven;

            if (Event.current.type == EventType.Repaint)
            {
                gUIStyle.Draw(position, GUIContent.none, false, false, selected, false);
            }
        }
        protected static void DrawBackground(int row, bool selected)
        {
            Rect     rect     = MemoryTreeList.GenerateRect(row);
            GUIStyle guiStyle = row % 2 != 0 ? MemoryTreeList.styles.entryOdd : MemoryTreeList.styles.entryEven;

            if (Event.current.type != EventType.Repaint)
            {
                return;
            }
            guiStyle.Draw(rect, GUIContent.none, false, false, selected, false);
        }