void closeInspect() { if (this.m_InspectorService == null) { return; } this.m_InspectorService.close(); this.m_InspectorService = null; foreach (var panel in this.m_Panels) { panel.Close(); } this.m_Panels.Clear(); this.m_ShowInspect = false; }
void inspect(WindowAdapter window) { if (this.m_InspectorService != null) // stop previous inspect { this.closeInspect(); } this.m_InspectorService = new InspectorService(window); this.m_PanelIndex = 0; var state = this.m_PanelStates.Find((s) => s.treeType == WidgetTreeType.Widget); this.m_Panels.Add(new InspectorPanel(this, WidgetTreeType.Widget, this.m_InspectorService, state == null ? (float?)null : state.splitOffset)); state = this.m_PanelStates.Find((s) => s.treeType == WidgetTreeType.Render); this.m_Panels.Add(new InspectorPanel(this, WidgetTreeType.Render, this.m_InspectorService, state == null ? (float?)null : state.splitOffset)); }
public InspectorPanel(EditorWindow window, WidgetTreeType treeType, InspectorService inspectorService, float?splitOffset = null) { this.m_Window = window; this.treeType = treeType; this.m_InspectorService = inspectorService; this.m_InspectorService.selectionChanged += this.handleSelectionChanged; this.m_TreeView = new InspectorTreeView(new TreeViewState()); this.m_TreeView.onNodeSelectionChanged += this.OnNodeSelectionChanged; this.m_TreeView.Reload(); if (treeType == WidgetTreeType.Widget) { this.m_DetailTreeView = new InspectorTreeView(new TreeViewState()); this.m_DetailTreeView.Reload(); } this.m_GroupName = Singleton <InspectorObjectGroupManager> .Instance.nextGroupName("inspector"); this.m_SplitOffset = splitOffset ?? window.position.height / 2; }