Example #1
0
        private void OnEnable()
        {
            //initialization
            this.levelHierarchyConfiguration  = AssetFinder.SafeSingleAssetFind <LevelHierarchyConfiguration>("t:" + typeof(LevelHierarchyConfiguration).Name);
            this.levelZonesSceneConfiguration = AssetFinder.SafeSingleAssetFind <LevelZonesSceneConfiguration>("t:" + typeof(LevelZonesSceneConfiguration).Name);
            this.chunkZonesSceneConfiguration = AssetFinder.SafeSingleAssetFind <ChunkZonesSceneConfiguration>("t:" + typeof(ChunkZonesSceneConfiguration).Name);
            //END

            var root = this.rootVisualElement;

            var searchBar = new ToolbarSearchField();

            searchBar.style.height         = 15;
            searchBar.style.justifyContent = Justify.Center;
            searchBar.RegisterValueChangedCallback(this.OnSearchChange);
            searchBar.focusable = true;
            searchBar.Focus();
            root.Add(searchBar);

            var scrollView = new ScrollView(ScrollViewMode.Vertical);

            root.Add(scrollView);
            var boundingBox = new Box();

            scrollView.Add(boundingBox);
            //HEADER
            Layout_HeadderLine(boundingBox, VisualElementWithStyle(new Label("Scene path"), HeaderLabelStyle()), VisualElementWithStyle(new Label("Scene ref"), HeaderLabelStyle()));
            //CONTENT
            this.DoDisplayLevels(boundingBox);
        }
Example #2
0
        private List <SceneAsset> RefreshScenesToLoad()
        {
            this.levelManager = GameObject.FindObjectOfType <LevelManager>();
            if (levelManager == null)
            {
                Debug.LogError("No level manager found.");
                return(null);
            }
            else
            {
                this.levelHierarchyConfiguration = AssetFinder.SafeSingleAssetFind <LevelHierarchyConfiguration>("t:" + typeof(LevelHierarchyConfiguration).Name);
                this.chunkZonesConfiguration     = AssetFinder.SafeSingleAssetFind <ChunkZonesSceneConfiguration>("t:" + typeof(ChunkZonesSceneConfiguration).Name);
                if (chunkZonesConfiguration == null)
                {
                    Debug.LogError("The chunk zone configuration has not been found.");
                    return(null);
                }
            }

            return(levelHierarchyConfiguration.GetLevelHierarchy(levelManager.GetCurrentLevel()).ConvertAll((chunkId) => { return chunkZonesConfiguration.ConfigurationInherentData[chunkId].scene; }));
        }