protected virtual void OnObjectMarkAsDestroyedChanged(ExposeToEditor o) { if (o.MarkAsDestroyed) { m_treeView.RemoveChild(o.GetParent(), o); } else { ExposeToEditor parent = o.GetParent(); m_treeView.AddChild(parent, o); SetSiblingIndex(o); } }
protected virtual void OnObjectAwaked(ExposeToEditor obj) { if (!m_isSpawningPrefab) { if (!obj.MarkAsDestroyed && m_treeView.IndexOf(obj) == -1) { ExposeToEditor parent = obj.GetParent(); m_treeView.AddChild(parent, obj); } } }
protected virtual void OnObjectDestroying(ExposeToEditor o) { ExposeToEditor parent = o.GetParent(); try { m_treeView.ItemsRemoved -= OnItemsRemoved; m_treeView.RemoveChild(parent, o); } finally { m_treeView.ItemsRemoved += OnItemsRemoved; } }
protected virtual void OnObjectMarkAsDestroyedChanged(ExposeToEditor obj) { if (obj.MarkAsDestroyed) { m_treeView.RemoveChild(obj.GetParent(), obj); } else { if (IsFilterEmpty) { ExposeToEditor parent = obj.GetParent(); m_treeView.AddChild(parent, obj); SetSiblingIndex(obj); } else { if (Filter(obj)) { AddSortedByName(obj); } } } }
private void OnSelectionChanging(object sender, RuntimeSelectionChangingArgs e) { var selected = e.Selected; for (int i = selected.Count - 1; i >= 0; i--) { GameObject go = (GameObject)selected[i]; ExposeToEditor exposed = go.GetComponent <ExposeToEditor>(); ExposeToEditor parent = exposed.GetParent(); if (parent != null) { selected.Add(parent.gameObject); selected.RemoveAt(i); } } }
protected virtual void Expand(ExposeToEditor item) { if (item == null) { return; } ExposeToEditor parent = item.GetParent(); if (parent != null && !m_treeView.IsExpanded(parent)) { Expand(parent); } if (item.HasChildren()) { m_treeView.Expand(item); } }
protected virtual void OnObjectDestroying(ExposeToEditor o) { try { m_treeView.ItemsRemoved -= OnItemsRemoved; if (IsFilterEmpty) { ExposeToEditor parent = o.GetParent(); m_treeView.RemoveChild(parent, o); } else { m_treeView.RemoveChild(null, o); } } finally { m_treeView.ItemsRemoved += OnItemsRemoved; } }