protected virtual void BindGameObjects(bool forceUseCache = false, bool updateSelection = true)
        {
            bool useCache = Editor.IsPlaying;

            string filter = m_filterInput.text;
            IEnumerable <ExposeToEditor> objects = Editor.Object.Get(IsFilterEmpty, useCache || forceUseCache);

            if (IsFilterEmpty)
            {
                if (objects.Any())
                {
                    Transform commonParent = objects.First().transform.parent;
                    foreach (ExposeToEditor obj in objects)
                    {
                        if (obj.transform.parent != commonParent)
                        {
                            Debug.LogWarning("ExposeToEditor objects have different parents, hierarchy may not work correctly.");
                            break;
                        }
                    }
                }

                m_treeView.SetItems(objects.OrderBy(g => g.transform.GetSiblingIndex()), updateSelection);
            }
            else
            {
                objects = objects.Where(Filter);
                m_treeView.SetItems(objects.OrderBy(g => g.name), updateSelection);
            }
        }
예제 #2
0
        private void BindGameObjects(bool forceUseCache = false, bool updateSelection = true)
        {
            bool useCache = Editor.IsPlaying;
            IEnumerable <ExposeToEditor> objects = Editor.Object.Get(true, useCache || forceUseCache);

            if (objects.Any())
            {
                Transform commonParent = objects.First().transform.parent;
                foreach (ExposeToEditor obj in objects)
                {
                    if (obj.transform.parent != commonParent)
                    {
                        Debug.LogWarning("ExposeToEditor objects have different parents, hierarchy may not work correctly.");
                        break;
                    }
                }
            }

            m_treeView.SetItems(objects.OrderBy(g => g.transform.GetSiblingIndex()), updateSelection);
        }