コード例 #1
0
        private void OnItemExpanding(object sender, ItemExpandingArgs e)
        {
            GameObject     gameObject     = (GameObject)e.Item;
            ExposeToEditor exposeToEditor = gameObject.GetComponent <ExposeToEditor>();

            if (exposeToEditor.ChildCount > 0)
            {
                e.Children = exposeToEditor.GetChildren().Select(obj => obj.gameObject);

                //This line is required to syncronize selection, runtime selection and treeview selection
                OnTreeViewSelectionChanged(m_treeView.SelectedItems, m_treeView.SelectedItems);
            }
        }
コード例 #2
0
ファイル: HierarchyViewImpl.cs プロジェクト: lbm7926/Imp
        protected virtual void OnItemExpanding(object sender, VirtualizingItemExpandingArgs e)
        {
            ExposeToEditor exposeToEditor = (ExposeToEditor)e.Item;

            if (exposeToEditor.HasChildren())
            {
                e.Children = exposeToEditor.GetChildren().Where(obj => !obj.MarkAsDestroyed);

                //This line is required to syncronize selection, runtime selection and treeview selection
                OnTreeViewSelectionChanged(m_treeView.SelectedItems, m_treeView.SelectedItems);
            }
            else
            {
                e.Children = new ExposeToEditor[0];
            }
        }
コード例 #3
0
        private void OnItemExpanding(object sender, ItemExpandingArgs e)
        {
            GameObject     gameObject     = (GameObject)e.Item;
            ExposeToEditor exposeToEditor = gameObject.GetComponent <ExposeToEditor>();

            //gameObject.GetComponentsInChildren<ExposeToEditor>(true).Where(exp =>
            //    exp != exposeToEditor &&
            //    exp.transform.parent.GetComponentsInParent<ExposeToEditor>(true).FirstOrDefault() == exposeToEditor);


            if (exposeToEditor.ChildCount > 0)
            {
                e.Children = exposeToEditor.GetChildren().Where(obj => !obj.MarkAsDestroyed).Select(obj => obj.gameObject);

                //This line is required to syncronize selection, runtime selection and treeview selection
                OnTreeViewSelectionChanged(m_treeView.SelectedItems, m_treeView.SelectedItems);
            }
        }