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