Ejemplo n.º 1
0
        private void BuildProcess()
        {
            Stopwatch levelBuildTimer = Stopwatch.StartNew();

            LDtkPostProcessorCache.Initialize();

            CreateRootObject();

            List <GameObject> levelObjects = new List <GameObject>();

            foreach (Level lvl in _projectData.Levels)
            {
                LDtkLevelBuilder levelBuilder = new LDtkLevelBuilder(_importer, _projectData, lvl);

                GameObject levelObj = levelBuilder.BuildLevel();
                levelObj.transform.parent = RootObject.transform;

                levelObjects.Add(levelObj);
            }

            LevelObjects = levelObjects.ToArray();

            InvokeCustomPostProcessing();

            levelBuildTimer.Stop();

            if (LDtkPrefs.LogBuildTimes && _projectData.Levels.Length > 1)
            {
                double ms = levelBuildTimer.ElapsedMilliseconds;
                Debug.Log($"LDtk: Built levels in {ms}ms ({ms / 1000}s)");
            }
        }
Ejemplo n.º 2
0
        private void BuildProcess()
        {
            CreateRootObject();

            Stopwatch levelBuildTimer = Stopwatch.StartNew();

            List <GameObject> levelObjects = new List <GameObject>();

            foreach (Level fileLevel in _projectData.Levels)
            {
                LDtkLevelBuilder levelBuilder = new LDtkLevelBuilder(_importer, _projectData, fileLevel);
                GameObject       level        = levelBuilder.BuildLevel();
                level.transform.parent = RootObject.transform;

                levelObjects.Add(level);
            }

            LevelObjects = levelObjects.ToArray();

            levelBuildTimer.Stop();

            if (_importer.LogBuildTimes && _projectData.Levels.Length > 1)
            {
                double ms = levelBuildTimer.ElapsedMilliseconds;
                Debug.Log($"LDtk: Built levels in {ms}ms ({ms / 1000}s)");
            }
        }