Пример #1
0
        /// <inheritdoc />
        public override void OnInit()
        {
            // Setup content root node
            _root = new RootContentTreeNode();
            _root.ChildrenIndent = 0;
            _root.Expand();
            AddFolder2Root(Editor.ContentDatabase.ProjectContent);
            AddFolder2Root(Editor.ContentDatabase.ProjectSource);
            if (Editor.IsDevInstance())
            {
                // Flax internal assets locations
                AddFolder2Root(Editor.ContentDatabase.EnginePrivate);
                AddFolder2Root(Editor.ContentDatabase.EditorPrivate);
            }
            _tree.Margin = new Margin(0.0f, 0.0f, -16.0f, 2.0f); // Hide root node
            _tree.AddChild(_root);
            _root.SortChildrenRecursive();

            // Setup navigation
            _navigationUnlocked = true;
            _tree.Select(_root);
            NavigationClearHistory();

            // Update UI layout
            UnlockChildrenRecursive();
            PerformLayout();

            // TODO: load last viewed folder
        }
Пример #2
0
        /// <inheritdoc />
        public override void OnInit()
        {
            // Setup content root node
            _root = new RootContentTreeNode();
            _root.ChildrenIndent = 0;
            _root.Expand(true);
            foreach (var project in Editor.ContentDatabase.Projects)
            {
                AddFolder2Root(project);
            }
            Editor.ContentDatabase.Game?.Expand(true);
            _tree.Margin = new Margin(0.0f, 0.0f, -16.0f, 2.0f); // Hide root node
            _tree.AddChild(_root);
            _root.SortChildrenRecursive();

            // Setup navigation
            _navigationUnlocked = true;
            _tree.Select(_root);
            NavigationClearHistory();

            // Update UI layout
            UnlockChildrenRecursive();
            PerformLayout();

            // Load last viewed folder
            if (Editor.ProjectCache.TryGetCustomData(ProjectDataLastViewedFolder, out var lastViewedFolder))
            {
                if (Editor.ContentDatabase.Find(lastViewedFolder) is ContentFolder folder)
                {
                    _tree.Select(folder.Node);
                }
            }
        }