UnityEditor.MemoryElementSelection.SetSelection C# (CSharp) Method

SetSelection() public method

public SetSelection ( MemoryElement node ) : void
node MemoryElement
return void
        public void SetSelection(MemoryElement node)
        {
            this.m_Selected = node;
            for (MemoryElement element = node.parent; element != null; element = element.parent)
            {
                element.expanded = true;
            }
        }

Usage Example

示例#1
0
        protected void RowClicked(Event evt, MemoryElement memoryElement)
        {
            m_MemorySelection.SetSelection(memoryElement);
            GUIUtility.keyboardControl = m_ControlID;

            if (evt.clickCount == 2 && memoryElement.memoryInfo != null && memoryElement.memoryInfo.instanceId != 0)
            {
                Selection.instanceIDs      = new int[0];
                Selection.activeInstanceID = memoryElement.memoryInfo.instanceId;
            }
            evt.Use();
            if (memoryElement.memoryInfo != null)
            {
                EditorGUIUtility.PingObject(memoryElement.memoryInfo.instanceId);
            }

            if (m_DetailView != null)
            {
                m_DetailView.SetRoot(memoryElement.memoryInfo == null ? null : new MemoryElement(memoryElement.memoryInfo, false));
            }

            m_ProfilerWindow.Repaint();
        }