Esempio n. 1
0
        void OnEnable()
        {
            titleContent = new GUIContent(k_WindowName, EditorIcons.EntityGroup);
            minSize      = k_MinWindowSize;

            Resources.Templates.CommonResources.AddStyles(rootVisualElement);
            Resources.Templates.DotsEditorCommon.AddStyles(rootVisualElement);
            rootVisualElement.AddToClassList(UssClasses.Resources.EntityHierarchy);

            m_EntityHierarchyQueryBuilder.Initialize();

            CreateToolbar();
            m_EntityHierarchy = new EntityHierarchy();
            rootVisualElement.Add(m_EntityHierarchy);
            CreateEnableLiveLinkMessage();

            m_EntityHierarchy.Refresh(this);

            if (!string.IsNullOrEmpty(SearchFilter))
            {
                OnFilterChanged(SearchFilter);
            }

            LiveLinkConfigHelper.LiveLinkEnabledChanged += UpdateEnableLiveLinkMessage;
            EditorApplication.playModeStateChanged      += UpdateEnableLiveLinkMessage;
        }
Esempio n. 2
0
        void OnEnable()
        {
            titleContent = new GUIContent(k_WindowName, EditorIcons.EntityGroup);
            minSize      = k_MinWindowSize;

            m_Root = new VisualElement {
                style = { flexGrow = 1 }
            };
            rootVisualElement.Add(m_Root);

            m_NoWorld = new CenteredMessageElement()
            {
                Message = NoWorldMessageContent
            };
            rootVisualElement.Add(m_NoWorld);
            m_NoWorld.Hide();

            Resources.Templates.CommonResources.AddStyles(m_Root);
            Resources.Templates.DotsEditorCommon.AddStyles(m_Root);
            m_Root.AddToClassList(UssClasses.Resources.EntityHierarchy);

            CreateToolbar();
            m_EntityHierarchy = new EntityHierarchy(new EntityHierarchyFoldingState(EditorWindowInstanceKey));
            m_Root.Add(m_EntityHierarchy);
            CreateEnableLiveLinkMessage();

            m_EntityHierarchy.Refresh(this);

            m_SearchElement.Search(SearchFilter);

            LiveLinkConfigHelper.LiveLinkEnabledChanged += UpdateEnableLiveLinkMessage;
            EditorApplication.playModeStateChanged      += UpdateEnableLiveLinkMessage;
        }