//private VirtualizingTreeViewItem Expand(ProjectItem projectItem) //{ // //VirtualizingTreeViewItem treeViewItem = m_treeView.GetTreeViewItem(projectItem); // //if (treeViewItem == null) // //{ // // if(projectItem.Parent == null) // // { // // } // // else // // { // // Expand(projectItem.Parent); // // treeViewItem = m_treeView.GetTreeViewItem(projectItem); // // } // //} // //else // //{ // // treeViewItem.IsExpanded = true; // //} // //return treeViewItem; //} private void Toggle(ProjectItem projectItem) { VirtualizingTreeViewItem treeViewItem = m_treeView.GetTreeViewItem(projectItem); if (treeViewItem == null) { Toggle(projectItem.Parent); treeViewItem = m_treeView.GetTreeViewItem(projectItem); } else { treeViewItem.IsExpanded = !treeViewItem.IsExpanded; } }
public virtual void Rename(ProjectItem projectItem, string newName) { VirtualizingTreeViewItem tvItem = m_listBox.GetTreeViewItem(projectItem); if (tvItem == null) { return; } TextMeshProUGUI text = tvItem.ItemPresenter.GetComponentInChildren <TextMeshProUGUI>(true); if (text != null) { Rename(text, projectItem, newName); } }
protected virtual void RenameContextMenuCmd(string arg) { VirtualizingTreeViewItem treeViewItem = m_treeView.GetTreeViewItem(m_treeView.SelectedItem); if (treeViewItem != null && treeViewItem.CanEdit) { treeViewItem.IsEditing = true; } }
private void Rename(string arg) { VirtualizingTreeViewItem treeViewItem = m_listBox.GetTreeViewItem(m_listBox.SelectedItem); if (treeViewItem != null && treeViewItem.CanEdit) { treeViewItem.IsEditing = true; } }
private void OnItemDoubleClick(object sender, ItemArgs e) { VirtualizingTreeViewItem treeViewItem = m_treeView.GetTreeViewItem(e.Items[0]); if (treeViewItem != null) { treeViewItem.IsExpanded = !treeViewItem.IsExpanded; } Input.ActivateInputField(); }
public void ChangeParent(ProjectItem projectItem, ProjectItem oldParent) { if (!m_treeView.IsDropInProgress && m_treeView.GetItemContainerData(projectItem) != null) { m_treeView.ChangeParent(projectItem.Parent, projectItem); } VirtualizingTreeViewItem tvOldParent = m_treeView.GetTreeViewItem(oldParent); if (tvOldParent != null) { tvOldParent.CanExpand = oldParent.Children != null && oldParent.Children.Any(c => c.IsFolder); } VirtualizingTreeViewItem tvNewParent = m_treeView.GetTreeViewItem(projectItem.Parent); if (tvNewParent != null) { tvNewParent.CanExpand = true; } }
private void OnObjectAwaked(ExposeToEditor o) { if (o is ExposeToEditor) { if (m_isSpawningPrefab && m_treeView.DropAction != ItemDropAction.None) { VirtualizingTreeViewItem treeViewItem = m_treeView.GetTreeViewItem(m_treeView.DropTarget); GameObject dropTarget = (GameObject)m_treeView.DropTarget; if (m_treeView.DropAction == ItemDropAction.SetLastChild) { o.transform.SetParent(dropTarget.transform); if (m_treeView.IndexOf(o.gameObject) == -1) { m_treeView.AddChild(dropTarget, o.gameObject); } treeViewItem.CanExpand = true; treeViewItem.IsExpanded = true; } else { int index; if (m_treeView.DropAction == ItemDropAction.SetNextSibling) { index = m_treeView.IndexOf(dropTarget) + 1; } else { index = m_treeView.IndexOf(dropTarget); } o.transform.SetParent(dropTarget.transform.parent); o.transform.SetSiblingIndex(index); TreeViewItemContainerData itemContainerData = (TreeViewItemContainerData)m_treeView.Insert(index, o.gameObject); itemContainerData.Parent = treeViewItem.Parent; //TreeViewItem newTreeViewItem = (TreeViewItem)m_treeView.Insert(index, o.gameObject); //newTreeViewItem.Parent = treeViewItem.Parent; } } else { ExposeToEditor obj = o; GameObject parent = null; if (obj.Parent != null) { parent = obj.Parent.gameObject; } if (m_treeView.IndexOf(obj.gameObject) == -1) { m_treeView.AddChild(parent, obj.gameObject); } } m_isSpawningPrefab = false; } }
protected virtual void OnObjectEnabled(ExposeToEditor obj) { VirtualizingTreeViewItem tvItem = m_treeView.GetTreeViewItem(obj); if (tvItem == null) { return; } TextMeshProUGUI text = tvItem.GetComponentInChildren <TextMeshProUGUI>(); text.color = m_hierarchyView.EnabledItemColor; }
private void OnObjectEnabled(ExposeToEditor obj) { VirtualizingTreeViewItem tvItem = m_treeView.GetTreeViewItem(obj); if (tvItem == null) { return; } Text text = tvItem.GetComponentInChildren <Text>(); text.color = EnabledItemColor; }