private void OnItemExpanding(object sender, ItemExpandingArgs e)
        {
            ProjectItem item = e.Item as ProjectItem;

            if (item != null)
            {
                e.Children = item.Children.Where(projectItem => projectItem.IsFolder).OrderBy(projectItem => projectItem.Name)
                             .Union(item.Children.Where(projectItem => projectItem.IsScene).OrderBy(projectItem => projectItem.Name));
            }
        }
Beispiel #2
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);
            }
        }
Beispiel #3
0
        private void OnItemExpanding(object sender, ItemExpandingArgs e)
        {
            ProjectItem item = e.Item as ProjectItem;

            if (item != null)
            {
                item.Children = item.Children
                                .OrderBy(projectItem => projectItem.NameExt).ToList();
                e.Children = item.Children
                             .Where(projectItem => CanDisplayFolder(projectItem))
                             .OrderBy(projectItem => projectItem.NameExt);
            }
        }
Beispiel #4
0
 private void OnItemExpanding(object sender, ItemExpandingArgs e)
 {
     GameObject gameObject = (GameObject)e.Item;
     if (gameObject.transform.childCount > 0)
     {
         GameObject[] children = new GameObject[gameObject.transform.childCount];
         for (int i = 0; i < children.Length; ++i)
         {
             children[i] = gameObject.transform.GetChild(i).gameObject;
         }
         e.Children = children;
     }
 }
Beispiel #5
0
        private void OnItemExpanding(object sender, ItemExpandingArgs e) {
            //get parent data item (game object in our case)
            TreeData td = ((GameObject)e.Item).GetComponent<TreeData>();
            int size = td.nodes.Count;
            if (size > 0) {
                //get children
                GameObject[] children = new GameObject[size];
                for (int i = 0; i < td.nodes.Count; ++i) {
                    children[i] = td.nodes[i];
                }

                //Populate children collection
                e.Children = children;
            }
        }
Beispiel #6
0
 private void OnItemExpanding(object sender, ItemExpandingArgs e)
 {
     //get parent data item (game object in our case)
     GameObject gameObject = (GameObject)e.Item;
     if(gameObject.transform.childCount > 0)
     {
         //get children
         GameObject[] children = new GameObject[gameObject.transform.childCount];
         for(int i = 0; i < children.Length; ++i)
         {
             children[i] = gameObject.transform.GetChild(i).gameObject;
         }
         
         //Populate children collection
         e.Children = children;
     }
 }
Beispiel #7
0
    private void OnItemExpanding(object sender, ItemExpandingArgs e)
    {
        //get parent data item (game object in our case)
        GameObject gameObject = (GameObject)e.Item;

        if (gameObject.transform.childCount > 0)
        {
            //get children
            GameObject[] children = new GameObject[gameObject.transform.childCount];
            for (int i = 0; i < children.Length; ++i)
            {
                children[i] = gameObject.transform.GetChild(i).gameObject;
            }
            //Populate children collection
            e.Children = children;
        }
        updateTreeText();
    }
        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);
            }
        }
Beispiel #9
0
    private void OnItemExpanding(object sender, ItemExpandingArgs e)
    {
        //get parent data item (game object in our case)
        GameObject gameObject = (GameObject)e.Item;

        if (gameObject.transform.childCount > 0)
        {
            //get children
            List <GameObject> children = new List <GameObject>();
            foreach (Transform child in gameObject.transform)
            {
                if (child.tag == "CUI")
                {
                    children.Add(child.gameObject);
                }
            }
            //Populate children collection
            e.Children = children;
        }
    }
    private void OnItemExpanding(object sender, ItemExpandingArgs e)
    {
        //get parent data item (game object in our case)
        MyCustomData data = (MyCustomData)e.Item;

        if (data.level < 3)
        {
            if (data.level == 0)
            {
                wwwForm = new WWWForm();
                wwwForm.AddField("c", data.code);
                www = new WWW(controlHub.networkAgent.bootstrapData.extraServer + ":" + controlHub.networkAgent.bootstrapData.extraServerPort + Utils.getLocalitiesListScript, wwwForm);
                while (!www.isDone)
                {
                }                 // O.o this is no bueno....
                string[]            locs        = www.text.Split(';');
                List <MyCustomData> level1Items = new List <MyCustomData> ();
                for (int i = 0; i < locs.Length - 1; ++i)
                {
                    string[] components = locs [i].Split(':');
                    level1Items.Add(new MyCustomData(1, components[0], components[1], i, 1, data));
                }
                e.Children    = level1Items;
                expandCountry = data.name;
                //state = 10; // retrieve localities
            }

            if (data.level == 1)
            {
                wwwForm = new WWWForm();
                wwwForm.AddField("l", data.code);
                wwwForm.AddField("c", data.parent.code);
                www = new WWW(controlHub.networkAgent.bootstrapData.extraServer + ":" + controlHub.networkAgent.bootstrapData.extraServerPort + Utils.getOrganizationsListScript, wwwForm);
                while (!www.isDone)
                {
                }                 // O.o
                string[]            locs        = www.text.Split(';');
                List <MyCustomData> level2Items = new List <MyCustomData> ();
                for (int i = 0; i < locs.Length - 1; ++i)
                {
                    //string[] components = locs [i].Split (':');
                    level2Items.Add(new MyCustomData(1, locs[i], locs[i], i, 2, data));
                }
                e.Children = level2Items;
            }

            if (data.level == 2)
            {
                wwwForm = new WWWForm();
                wwwForm.AddField("o", data.code);
                wwwForm.AddField("l", data.parent.code);
                wwwForm.AddField("c", data.parent.parent.code);
                www = new WWW(controlHub.networkAgent.bootstrapData.extraServer + ":" + controlHub.networkAgent.bootstrapData.extraServerPort + Utils.getClassroomsListScript, wwwForm);
                while (!www.isDone)
                {
                }                 // O.o
                string[]            locs        = www.text.Split(';');
                List <MyCustomData> level3Items = new List <MyCustomData> ();
                for (int i = 0; i < locs.Length - 1; ++i)
                {
                    string[]     components = locs [i].Split(':');
                    MyCustomData newData    = new MyCustomData(1, components [0], components[1], i, 3, data);
                    newData.serverroom = components [1];
                    level3Items.Add(newData);
                }
                e.Children = level3Items;
            }
        }
        //currentItemExpandingArgs = e;
    }