Example #1
0
        public EntityHierarchyTree(Session session, TreeViewState state) : base(state)
        {
            useScrollView           = true;
            m_Session               = session;
            m_EntityManager         = session.GetManager <IWorldManager>().EntityManager;
            m_CachedSceneItems      = new Dictionary <SceneGuid, TreeViewItem>();
            m_SceneManager          = m_Session.GetManager <IEditorSceneManagerInternal>();
            m_ComponentCache        = m_Session.GetManager <UnityComponentCacheManager>();
            m_HierarchySearchFilter = FilterUtility.CreateHierarchyFilter(m_EntityManager, string.Empty);
            foldoutOverride         = HandleFoldout;

            m_DroppedOnMethod = new Dictionary <System.Type, DropOnItemAction>
            {
                { typeof(SceneItem), DropUponSceneItem },
                { typeof(EntityItem), DropUponEntityItem },
            };

            m_DroppedBetweenMethod = new Dictionary <System.Type, DropBetweenAction>
            {
                { typeof(HierarchyItem), DropBetweenSceneItems },
                { typeof(SceneItem), DropBetweenRootEntities },
                { typeof(EntityItem), DropBetweenChildrenEntities },
            };

            IdsToExpand = new List <int>();
            Reload();
        }