private void Load_Generation() { try { string rootPath = Util.GetRootPath(this); if (!string.IsNullOrEmpty(rootPath)) { string path; switch (CurrentEditorMode) { case EditorMode.MapGenerator: path = Util.CombinePaths(rootPath, "Data", "Current Map Generation Preset.json"); if (Util.FileExists(path)) { MGConfig.LoadFromJson(Util.Read(path)); MGConfig.FixGenerationValues(); } break; case EditorMode.CharacterGenerator: path = Util.CombinePaths(rootPath, "Data", "Current Character Generation Preset.json"); if (Util.FileExists(path)) { CGConfig.LoadFromJson(Util.Read(path)); CGConfig.FixGenerationValues(); ReloadCharacterAttachmentThumbnailMap(true); } break; } } } catch { }; ShowAllAttachment.Load(); }
private void Generate() { try { switch (CurrentEditorMode) { case EditorMode.MapGenerator: MGConfig.FixGenerationValues(); Data = Core_MapGeneration.Generate(MGConfig, (progress01, step) => { ProgressStep(progress01, step, MAP_STEP_LABELS); }); break; case EditorMode.CharacterGenerator: CGConfig.FixGenerationValues(); Data = Core_CharacterGeneration.Generate(CGConfig, (progress01, step) => { ProgressStep(progress01, step, CHARACTER_STEP_LABELS); }); break; } SwitchModel(CurrentModelIndex, true); SetDataDirty(); } catch (System.Exception ex) { Debug.LogWarning("[Voxel Generator] " + ex.Message); } }