Esempio 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)");
            }
        }
Esempio n. 2
0
 private void SetupPostProcessing()
 {
     LDtkPostProcessorCache.AddPostProcessAction(() =>
     {
         LDtkPostProcessorInvoker.PostProcessLevel(_levelGameObject, _json);
     });
 }
Esempio n. 3
0
        private void InvokeCustomPostProcessing()
        {
            LDtkPostProcessorCache.AddPostProcessAction(() =>
            {
                LDtkPostProcessorInvoker.PostProcessProject(RootObject);
            });

            LDtkPostProcessorCache.PostProcess();
        }