public TreeViewItemState Show() { var treeViewItemState = new TreeViewItemState(); if (this.IsSelect) { GUILayout.BeginHorizontal(GUITreeView.selectBackgroundStyle); var labelButton = GUITool.LabelButton("", GUILayout.Width(this.Depth * 20)); var button = GUITool.LabelButton(this.Name); if (labelButton || button) { treeViewItemState.SelectOperation = TreeViewSelectOperation.Deselect; } GUILayout.EndHorizontal(); } else { GUILayout.BeginHorizontal(GUITreeView.deselectBackgroundStyle); bool button = GUITool.LabelButton("", GUILayout.Width(this.Depth * 20)); if (GUITool.LabelButton(this.Name) || button) { treeViewItemState.SelectOperation = TreeViewSelectOperation.Select; } GUILayout.EndHorizontal(); } return(treeViewItemState); }
public TreeViewItemState Show() { var treeViewItemState = new TreeViewItemState(); if (IsSelect) { GUILayout.BeginHorizontal(GUITreeView.selectBackgroundStyle); } else { GUILayout.BeginHorizontal(GUITreeView.deselectBackgroundStyle); } if (this.IsOpen) { bool selectButton = GUITool.LabelButton("", GUILayout.Width(this.Depth * 20)); bool closeButton = GUITool.LabelButton("\u25BC" + (char)0x200a, GUILayout.Width(12)); selectButton = GUITool.LabelButton(this.Name) || selectButton; if (closeButton) { treeViewItemState.OpenOperation = TreeViewOpenOperation.Close; } if (selectButton || closeButton) { treeViewItemState.SelectOperation = IsSelect ? TreeViewSelectOperation.Deselect : TreeViewSelectOperation.Select; } } else { bool selectButton = GUITool.LabelButton("", GUILayout.Width(this.Depth * 20)); var openButton = GUITool.LabelButton("\u25BA" + (char)0x200a, GUILayout.Width(12)); selectButton = GUITool.LabelButton(this.Name) || selectButton; if (openButton) { treeViewItemState.OpenOperation = TreeViewOpenOperation.Open; } if (selectButton) { treeViewItemState.SelectOperation = IsSelect ? TreeViewSelectOperation.Deselect : TreeViewSelectOperation.Select; } } GUILayout.EndHorizontal(); return(treeViewItemState); }