├── Config ├── C.普通常量-CommonConst.xlsx ├── Generator │ ├── CHANGELOG.md │ ├── Config.json │ ├── dist │ │ ├── CSTypeEnum.js │ │ ├── CodeLang.js │ │ ├── CodeLanguageEnum.js │ │ ├── DataModel.js │ │ ├── IConfig.js │ │ ├── IConfigExport.js │ │ ├── Main.js │ │ ├── Remark.js │ │ ├── RemarkField.js │ │ ├── SheetType.js │ │ ├── SpecialType.js │ │ ├── TSTypeEnum.js │ │ ├── genModules │ │ │ ├── GenCSModule.js │ │ │ ├── GenETCSModule.js │ │ │ ├── GenOriginModule.js │ │ │ ├── GenTSModule.js │ │ │ └── SheetInfo.js │ │ └── utils │ │ │ ├── CodeWriter.js │ │ │ ├── CommonUtils.js │ │ │ ├── IOUtils.js │ │ │ ├── LineBreak.js │ │ │ ├── StrUtils.js │ │ │ └── StringUtils.js │ ├── img │ │ ├── array.png │ │ ├── enum.png │ │ ├── enum_sheet.png │ │ ├── field_name.png │ │ ├── gen_to.png │ │ └── link.png │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── CSTypeEnum.ts │ │ ├── CodeLang.ts │ │ ├── CodeLanguageEnum.ts │ │ ├── DataModel.ts │ │ ├── IConfig.ts │ │ ├── IConfigExport.ts │ │ ├── Main.ts │ │ ├── Remark.ts │ │ ├── RemarkField.ts │ │ ├── SheetType.ts │ │ ├── SpecialType.ts │ │ ├── TSTypeEnum.ts │ │ ├── genModules │ │ │ ├── GenCSModule.ts │ │ │ ├── GenETCSModule.ts │ │ │ ├── GenOriginModule.ts │ │ │ ├── GenTSModule.ts │ │ │ └── SheetInfo.ts │ │ └── utils │ │ │ ├── CodeWriter.ts │ │ │ ├── CommonUtils.ts │ │ │ ├── IOUtils.ts │ │ │ ├── LineBreak.ts │ │ │ ├── StrUtils.ts │ │ │ └── StringUtils.ts │ ├── templates │ │ ├── 1 │ │ │ ├── scripts │ │ │ │ ├── BaseConfig.cs │ │ │ │ └── ConfigUtility.cs │ │ │ └── template │ │ │ │ ├── ConfigEnum.txt │ │ │ │ ├── ConfigItem.txt │ │ │ │ ├── ConfigMgr.txt │ │ │ │ └── ConfigSingle.txt │ │ └── 2 │ │ │ ├── scripts │ │ │ └── BaseConfig.ts │ │ │ └── template │ │ │ ├── ConfigEnum.txt │ │ │ ├── ConfigItem.txt │ │ │ ├── ConfigItemVar.txt │ │ │ ├── ConfigMgr.txt │ │ │ ├── ConfigSingle.txt │ │ │ └── ConfigVar.txt │ ├── tsconfig.json │ └── tslint.json ├── README.MD ├── gen.bat ├── package-lock.json ├── package.json ├── 宠物 │ ├── C.宠物-Pet.xlsx │ ├── C.宠物升阶升级表-PetStepLv.xlsx │ └── C.宠物类型枚举-PetType.xlsx ├── 属性 │ ├── S.属性字段转ID-AttrField2ID.xlsx │ └── S.属性表-Attr.xlsx └── 物品 │ ├── W.物品-Goods.xlsx │ ├── W.物品类型枚举-GoodsType.xlsx │ ├── Z.装备-Equip.xlsx │ └── Z.装备位置枚举-EquipPosition.xlsx ├── Example ├── CCCProject │ ├── README.md │ ├── assets │ │ ├── config.meta │ │ ├── resources.meta │ │ ├── resources │ │ │ ├── config.meta │ │ │ └── config │ │ │ │ ├── config.json │ │ │ │ └── config.json.meta │ │ ├── scenes.meta │ │ ├── scenes │ │ │ ├── Example.scene │ │ │ └── Example.scene.meta │ │ ├── scripts.meta │ │ └── scripts │ │ │ ├── Example.ts │ │ │ ├── Example.ts.meta │ │ │ ├── config.meta │ │ │ └── config │ │ │ ├── AttrConfigItem.ts │ │ │ ├── AttrConfigItem.ts.meta │ │ │ ├── AttrField2IDConfigItem.ts │ │ │ ├── AttrField2IDConfigItem.ts.meta │ │ │ ├── BaseConfig.ts │ │ │ ├── BaseConfig.ts.meta │ │ │ ├── ConfigMgr.ts │ │ │ ├── ConfigMgr.ts.meta │ │ │ ├── EquipConfigItem.ts │ │ │ ├── EquipConfigItem.ts.meta │ │ │ ├── EquipPosition.ts │ │ │ ├── EquipPosition.ts.meta │ │ │ ├── GoodsConfigItem.ts │ │ │ ├── GoodsConfigItem.ts.meta │ │ │ ├── GoodsType.ts │ │ │ ├── GoodsType.ts.meta │ │ │ ├── KVConfig.ts │ │ │ ├── KVConfig.ts.meta │ │ │ ├── PetConfigItem.ts │ │ │ ├── PetConfigItem.ts.meta │ │ │ ├── PetStepLvConfigItem.ts │ │ │ ├── PetStepLvConfigItem.ts.meta │ │ │ ├── PetType.ts │ │ │ └── PetType.ts.meta │ ├── package.json │ ├── profiles │ │ └── v2 │ │ │ ├── editor │ │ │ └── packages.json │ │ │ └── packages │ │ │ ├── builder.json │ │ │ ├── device.json │ │ │ ├── engine.json │ │ │ ├── program.json │ │ │ ├── project.json │ │ │ ├── scene.json │ │ │ └── server.json │ ├── settings │ │ └── v2 │ │ │ └── packages │ │ │ ├── builder.json │ │ │ ├── cocos-service.json │ │ │ ├── device.json │ │ │ ├── engine.json │ │ │ ├── information.json │ │ │ ├── program.json │ │ │ └── project.json │ └── tsconfig.json └── UnityProject │ ├── Assets │ ├── Resources.meta │ ├── Resources │ │ ├── Config.meta │ │ └── Config │ │ │ ├── Config.txt │ │ │ └── Config.txt.meta │ ├── Scenes.meta │ ├── Scenes │ │ ├── Example.unity │ │ └── Example.unity.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── Config.meta │ │ ├── Config │ │ ├── AttrConfigItem.cs │ │ ├── AttrConfigItem.cs.meta │ │ ├── AttrField2IDConfigItem.cs │ │ ├── AttrField2IDConfigItem.cs.meta │ │ ├── BaseConfig.cs │ │ ├── BaseConfig.cs.meta │ │ ├── ConfigMgr.cs │ │ ├── ConfigMgr.cs.meta │ │ ├── ConfigUtility.cs │ │ ├── ConfigUtility.cs.meta │ │ ├── EquipConfigItem.cs │ │ ├── EquipConfigItem.cs.meta │ │ ├── EquipPosition.cs │ │ ├── EquipPosition.cs.meta │ │ ├── GoodsConfigItem.cs │ │ ├── GoodsConfigItem.cs.meta │ │ ├── GoodsType.cs │ │ ├── GoodsType.cs.meta │ │ ├── KVConfig.cs │ │ ├── KVConfig.cs.meta │ │ ├── PetConfigItem.cs │ │ ├── PetConfigItem.cs.meta │ │ ├── PetStepLvConfigItem.cs │ │ ├── PetStepLvConfigItem.cs.meta │ │ ├── PetType.cs │ │ └── PetType.cs.meta │ │ ├── Example.cs │ │ └── Example.cs.meta │ ├── Packages │ ├── manifest.json │ └── packages-lock.json │ ├── ProjectSettings │ ├── AudioManager.asset │ ├── AutoStreamingSettings.asset │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── MemorySettings.asset │ ├── NavMeshAreas.asset │ ├── NetworkManager.asset │ ├── PackageManagerSettings.asset │ ├── Physics2DSettings.asset │ ├── PresetManager.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── SceneTemplateSettings.json │ ├── TagManager.asset │ ├── TimeManager.asset │ ├── UnityConnectSettings.asset │ ├── VFXManager.asset │ ├── VersionControlSettings.asset │ ├── XRSettings.asset │ └── boot.config │ └── README.md └── README.MD /Config/C.普通常量-CommonConst.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gh-kL/GameConfig/f1fc10bf55efe3a042f5c249f3335dceeb1ee246/Config/C.普通常量-CommonConst.xlsx -------------------------------------------------------------------------------- /Config/Generator/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CHANGELOG 2 | 3 | All notable changes to this package will be documented in this file. 4 | 5 | ## 1.0.5 6 | 7 | ### Added 8 | 9 | - 实现了表继承的Override功能:子表可以与父表拥有同样的字段,发布时,会以子表的值发布。 10 | - 配置导出项新增“模板名称”字段,以此提升模板文件重用性。 11 | - 配置新增“增量发布”字段。 12 | 13 | ## 1.0.2 14 | 15 | ### Added 16 | 17 | - 实现了表继承。 -------------------------------------------------------------------------------- /Config/Generator/Config.json: -------------------------------------------------------------------------------- 1 | { 2 | "excel_url": "../", 3 | "excel_override_enabled": true, 4 | "excel_override_warning_enabled": true, 5 | "excel_extend_max_layer": 100, 6 | "export_suffix": "Config", 7 | "export_item_suffix": "Item", 8 | "export_collection_suffix": "Map", 9 | "export_data_splitor_random_enabled": false, 10 | "export_data_splitor": "_D3A_", 11 | "origin_export_url": "../.cache/", 12 | "origin_json_url": "../.cache/config.min.json", 13 | "origin_remark_url": "../.cache/.remarks.json", 14 | "origin_enum_url": "../.cache/.enums.json", 15 | "origin_extends_url": "../.cache/.extends.json", 16 | "incrementalPublish": true, 17 | "exports": [ 18 | { 19 | "id": 1, 20 | "enabled": true, 21 | "code_language": "cs", 22 | "script_suffix": "cs", 23 | "template_name": "", 24 | "force_make_dir": true, 25 | "export_url": "../../Example/UnityProject/Assets/Resources/Config/Config.txt", 26 | "export_script_url": "../../Example/UnityProject/Assets/Scripts/Config/", 27 | "export_config_manager_name": "ConfigMgr" 28 | }, 29 | { 30 | "id": 2, 31 | "enabled": true, 32 | "code_language": "ts", 33 | "script_suffix": "ts", 34 | "template_name": "", 35 | "force_make_dir": true, 36 | "export_url": "../../Example/CCCProject/assets/resources/config/config.json", 37 | "export_script_url": "../../Example/CCCProject/assets/scripts/config/", 38 | "export_config_manager_name": "ConfigMgr" 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /Config/Generator/dist/CSTypeEnum.js: -------------------------------------------------------------------------------- 1 | "use strict";var t;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CSTypeEnum=void 0,function(t){t.Bool="bool",t.Int="int",t.String="string",t.Float="float",t.BoolList="IReadOnlyList",t.IntList="IReadOnlyList",t.StringList="IReadOnlyList",t.FloatList="IReadOnlyList",t.BoolList2="IReadOnlyList>",t.IntList2="IReadOnlyList>",t.StringList2="IReadOnlyList>",t.FloatList2="IReadOnlyList>",t.BoolList3="IReadOnlyList>>",t.IntList3="IReadOnlyList>>",t.StringList3="IReadOnlyList>>",t.FloatList3="IReadOnlyList>>",t.BoolList4="IReadOnlyList>>>",t.IntList4="IReadOnlyList>>>",t.StringList4="IReadOnlyList>>>",t.FloatList4="IReadOnlyList>>>",t.BoolList5="IReadOnlyList>>>>",t.IntList5="IReadOnlyList>>>>",t.StringList5="IReadOnlyList>>>>",t.FloatList5="IReadOnlyList>>>>"}(t=exports.CSTypeEnum||(exports.CSTypeEnum={})); -------------------------------------------------------------------------------- /Config/Generator/dist/CodeLang.js: -------------------------------------------------------------------------------- 1 | "use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CodeLang=void 0,function(e){e.CS="cs",e.TS="ts",e.ETCS="etcs"}(e=exports.CodeLang||(exports.CodeLang={})); -------------------------------------------------------------------------------- /Config/Generator/dist/CodeLanguageEnum.js: -------------------------------------------------------------------------------- 1 | "use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CodeLanguageEnum=void 0,function(e){e.CS="cs",e.TS="ts"}(e=exports.CodeLanguageEnum||(exports.CodeLanguageEnum={})); -------------------------------------------------------------------------------- /Config/Generator/dist/DataModel.js: -------------------------------------------------------------------------------- 1 | "use strict";var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.DataModel=void 0;const d=e(require("cli-color")),t=e(require("fs")),i=require("./utils/IOUtils"),T=require("./TSTypeEnum"),n=require("./utils/CommonUtils"),m=require("./CSTypeEnum"),h=require("./utils/StrUtils"),f=require("./SheetType"),p=require("./CodeLang");class C{static get Instance(){return null==this._instance&&(this._instance=new C),this._instance}get config(){var e;return this._config||(e=t.default.readFileSync("Config.json",{encoding:"utf-8"}),this._config=JSON.parse(e)),this._config}get originConfigURL(){return this.config.origin_json_url}get remarkURL(){return this.config.origin_remark_url}get enumURL(){return this.config.origin_enum_url}get originConfig(){var e;return this._originConfig||i.IOUtils.fileOrFolderIsExsit(this.originConfigURL)&&(e=t.default.readFileSync(this.originConfigURL,{encoding:"utf-8"}),this._originConfig=JSON.parse(e)),this._originConfig}get remark(){var e;return this._remark||i.IOUtils.fileOrFolderIsExsit(this.remarkURL)&&(e=t.default.readFileSync(this.remarkURL,{encoding:"utf-8"}),this._remark=JSON.parse(e)),this._remark}get enum(){var e;return this._enum||i.IOUtils.fileOrFolderIsExsit(this.enumURL)&&(e=t.default.readFileSync(this.enumURL,{encoding:"utf-8"}),this._enum=JSON.parse(e)),this._enum}reset(){this._originConfig=null,this._remark=null,this._enum=null}isConventionType(e,t){switch(t){case p.CodeLang.TS:for(var i in T.TSTypeEnum)if(T.TSTypeEnum[i]==e)return!0;break;case p.CodeLang.ETCS:case p.CodeLang.CS:}return!1}getConfigUniqueKeyType(e,t,i=!0){let n;switch(t){case p.CodeLang.TS:n=T.TSTypeEnum;break;case p.CodeLang.ETCS:case p.CodeLang.CS:n=m.CSTypeEnum}var e=this.remark[e];return 1==e.mainKeySubs.length?(e=e.fields[e.mainKeyNames[0]],i&&e.enum?e.enum:e.type?"int"==e.type&&t===p.CodeLang.TS?T.TSTypeEnum.Int:e.type:void 0):n.String}getFixedType(e,t,i){let r;switch(i){case p.CodeLang.TS:r=T.TSTypeEnum;break;case p.CodeLang.ETCS:case p.CodeLang.CS:r=m.CSTypeEnum}i=this.remark[e];let a=((null==i?void 0:i.fields)&&i.fields[t]).type;if(a){a=n.CommonUtils.deepClone(a);var s,e=Array.isArray(a);for(let n=(a=e?a:[a]).length-1;0<=n;n--){let e=a[n],t=e.trim(),i=0;for(;-1!=t.indexOf("[]");)t=t.substring(0,t.length-2),i++;i?(s=h.StrUtils.convertToUpperCamelCase(t),a[n]=r[s+"List"+(1i&&(i=+C),-1==e.indexOf(+C)&&e.push(+C);1{Array.isArray(e)?this.getArrayInfo(e,i,n,r+1):(e=this.getValueType(e,i))&&(n[e]||(n[e]={}),n[e][r]||(n[e][r]=0),n[e][r]++)}),n}getParents(e,t){let i,n=this.remark[e];for(;n;){var r=n.parent;n=r?(i?i.push(r):i=[r],this.remark[r]):null}return i&&t&&i.unshift(e),i}getConfigLinks(e){let t;var i=this.remark[e];if(null!=i&&i.fields)for(var n in i.fields){var n=i.fields[n];!n||(n=n.link)&&(t?t.push(n):t=[n])}return t}getMainKeyVarName(e){return C.MainKeyVarName+e}isMainKey(e,t){if(t.substring(0,C.MainKeyVarName.length)==C.MainKeyVarName)return!0;let i=this.remark[e];return!(null===i||void 0===i||!i.mainKeyNames)&&-1!=i.mainKeyNames.indexOf(t)}getConfigNamesAndCutDataByConfigType(n){var r;let u=Object.keys(this.originConfig);for(let e=u.length-1;0<=e;e--){var a=u[e];let i=this.originConfig[a];var s=this.remark[a];let t=!1;if(0==(null!=s&&s.fields?Object.keys(s).length:0))t=!0;else{var o=s.sheetType;let e;o==f.SheetType.Horizontal?e=i.fixed_keys:o==f.SheetType.Vertical&&(e=Object.keys(i));for(let t=e.length-1;0<=t;t--){var l=e[t];if(!(0<=(null==(r=s.fields[l].generate)?void 0:r.indexOf(n))))if(e.splice(t,1),o==f.SheetType.Horizontal)for(var g in i.data){let e=i.data[g];e.splice(t,1)}else delete i[l]}0==e.length&&(t=!0)}t&&u.splice(e,1)}for(;;){let s,o,l;for(let a=u.length-1;!s&&0<=a;a--)for(let r=u.length-1;!s&&0<=r;r--)if(a!=r){var C=u[a],y=u[r];let e=this.getConfigLinks(C),t=this.getConfigLinks(y),i=(e&&-1!=e.indexOf(y)?a{var t=this.originConfig[e],i=this.remark[e].sheetType;let n;i==f.SheetType.Horizontal?n=t.fixed_keys:i==f.SheetType.Vertical&&(n=Object.keys(t)),n.forEach(t=>{a.find(e=>e[0]==t)||a.push([t,this.getConfigKeyType(e,t,r),e])})}),a}getConfigCollectionTypeByIndex(t,i,n,r){var a=this.remark[t].mainKeyNames,s=t+C.Instance.config.export_item_suffix;n=n||0,r=r||a.length-1;let o;switch(i){case p.CodeLang.TS:o="Map";break;case p.CodeLang.ETCS:case p.CodeLang.CS:o="Dictionary"}let l="",u="";for(let e=n;e<=r;e++){var g=a[e],g=C.Instance.getConfigKeyType(t,g,i);l+=o+`<${g}, `,e==r&&(l+=""+s),u+=">"}return l+=u}getParseFuncNameByType(e,t){switch(t){case p.CodeLang.TS:console.log(d.default.red("TS没有这个烦恼,是从哪里调进来的?!你清醒一点!"));break;case p.CodeLang.ETCS:case p.CodeLang.CS:switch(e){case m.CSTypeEnum.Bool:return"ConfigUtility.ParseBool({0})";case m.CSTypeEnum.Int:return"ConfigUtility.ParseInt({0})";case m.CSTypeEnum.Float:return"ConfigUtility.ParseFloat({0})";case m.CSTypeEnum.String:return"{0}";case m.CSTypeEnum.BoolList:return"ConfigUtility.ParseBoolList({0})";case m.CSTypeEnum.IntList:return"ConfigUtility.ParseIntList({0})";case m.CSTypeEnum.FloatList:return"ConfigUtility.ParseFloatList({0})";case m.CSTypeEnum.StringList:return"ConfigUtility.ParseStringList({0})";case m.CSTypeEnum.BoolList2:return"ConfigUtility.ParseBoolList2({0})";case m.CSTypeEnum.IntList2:return"ConfigUtility.ParseIntList2({0})";case m.CSTypeEnum.FloatList2:return"ConfigUtility.ParseFloatList2({0})";case m.CSTypeEnum.StringList2:return"ConfigUtility.ParseStringList2({0})";case m.CSTypeEnum.BoolList3:return"ConfigUtility.ParseBoolList3({0})";case m.CSTypeEnum.IntList3:return"ConfigUtility.ParseIntList3({0})";case m.CSTypeEnum.FloatList3:return"ConfigUtility.ParseFloatList3({0})";case m.CSTypeEnum.StringList3:return"ConfigUtility.ParseStringList3({0})";case m.CSTypeEnum.BoolList4:return"ConfigUtility.ParseBoolList4({0})";case m.CSTypeEnum.IntList4:return"ConfigUtility.ParseIntList4({0})";case m.CSTypeEnum.FloatList4:return"ConfigUtility.ParseFloatList4({0})";case m.CSTypeEnum.StringList4:return"ConfigUtility.ParseStringList4({0})";case m.CSTypeEnum.BoolList5:return"ConfigUtility.ParseBoolList5({0})";case m.CSTypeEnum.IntList5:return"ConfigUtility.ParseIntList5({0})";case m.CSTypeEnum.FloatList5:return"ConfigUtility.ParseFloatList5({0})";case m.CSTypeEnum.StringList5:return"ConfigUtility.ParseStringList5({0})"}}}valEquip(e,t){var i=Array.isArray(e),n=Array.isArray(t);return i&&n?e==t||JSON.stringify(e)==JSON.stringify(t):!i&&!n&&e==t}}(exports.DataModel=C).MainKeyVarName="mainKey"; -------------------------------------------------------------------------------- /Config/Generator/dist/IConfig.js: -------------------------------------------------------------------------------- 1 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0}); -------------------------------------------------------------------------------- /Config/Generator/dist/IConfigExport.js: -------------------------------------------------------------------------------- 1 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0}); -------------------------------------------------------------------------------- /Config/Generator/dist/Main.js: -------------------------------------------------------------------------------- 1 | "use strict";var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const t=require("./DataModel"),l=require("./genModules/GenOriginModule"),i=e(require("cli-color")),o=e(require("uglify-js")),r=require("./genModules/GenTSModule"),n=require("./genModules/GenCSModule"),d=require("./utils/IOUtils"),a=e(require("fs")),s=e(require("path")),u=require("./CodeLang"),c=require("./genModules/GenETCSModule");t.DataModel.Instance.reset();let f=l.GenOriginModule.Instance.gen();if(f){let l=t.DataModel.Instance.config.exports;for(let e=0;e>>")):console.log(i.default.yellow("发布配置失败,发布配置过程中出现错误!请向上翻看是否有报错信息。")); -------------------------------------------------------------------------------- /Config/Generator/dist/Remark.js: -------------------------------------------------------------------------------- 1 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0}); -------------------------------------------------------------------------------- /Config/Generator/dist/RemarkField.js: -------------------------------------------------------------------------------- 1 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0}); -------------------------------------------------------------------------------- /Config/Generator/dist/SheetType.js: -------------------------------------------------------------------------------- 1 | "use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.SheetType=void 0,function(e){e.Enum="Enum",e.Horizontal="Horizontal",e.Vertical="Vertical"}(e=exports.SheetType||(exports.SheetType={})); -------------------------------------------------------------------------------- /Config/Generator/dist/SpecialType.js: -------------------------------------------------------------------------------- 1 | "use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.SpecialType=void 0,function(e){e.Array="array",e.Enum="enum",e.Link="link"}(e=exports.SpecialType||(exports.SpecialType={})); -------------------------------------------------------------------------------- /Config/Generator/dist/TSTypeEnum.js: -------------------------------------------------------------------------------- 1 | "use strict";var t;Object.defineProperty(exports,"__esModule",{value:!0}),exports.TSTypeEnum=void 0,function(t){t.Bool="boolean",t.Int="number",t.String="string",t.Float="number",t.BoolList="bool[]",t.IntList="number[]",t.StringList="string[]",t.FloatList="number[]",t.BoolList2="bool[][]",t.IntList2="number[][]",t.StringList2="string[][]",t.FloatList2="number[][]",t.BoolList3="bool[][][]",t.IntList3="number[][][]",t.StringList3="string[][][]",t.FloatList3="number[][][]",t.BoolList4="bool[][][][]",t.IntList4="number[][][][]",t.StringList4="string[][][][]",t.FloatList4="number[][][][]",t.BoolList5="bool[][][][][]",t.IntList5="number[][][][][]",t.StringList5="string[][][][][]",t.FloatList5="number[][][][][]",t.Any="any",t.AnyList="any[]"}(t=exports.TSTypeEnum||(exports.TSTypeEnum={})); -------------------------------------------------------------------------------- /Config/Generator/dist/genModules/GenTSModule.js: -------------------------------------------------------------------------------- 1 | "use strict";var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.GenTSModule=void 0;const O=e(require("cli-color")),E=e(require("path")),q=require("../utils/IOUtils"),F=require("../utils/StrUtils"),B=require("../DataModel"),j=require("../utils/CommonUtils"),b=require("../TSTypeEnum"),W=require("../utils/LineBreak"),A=require("../utils/CodeWriter");class t{static get Instance(){return null==this._instance&&(this._instance=new t),this._instance}gen(t){this._export=B.DataModel.Instance.config.exports.find(e=>e.id==t),this._codeLang=this._export.code_language,console.log(` 2 | ================================= 开始生成 ${this._export.id} 配置 ================================= 3 | `),q.IOUtils.deleteFile(this._export.export_url),q.IOUtils.deleteFolderFile(this._export.export_script_url,!1),q.IOUtils.makeDir(this._export.export_script_url),q.IOUtils.copy(`templates/${this._export.template_name||this._export.id}/scripts/`,this._export.export_script_url),this._configNames=B.DataModel.Instance.getConfigNamesAndCutDataByConfigType(t),this._configSplitor=B.DataModel.Instance.config.export_data_splitor,B.DataModel.Instance.config.export_data_splitor_random_enabled&&(this._configSplitor=F.StrUtils.genPassword(8,!0,!0,!1,!0));let e=this.genEnum();return e=(e=(e=e&&this.genItemAndVertical())&&this.genMgr())&&this.genConfigText()}genEnum(){var t=j.CommonUtils.getTemplate(this._export,"ConfigEnum.txt");let a=Object.keys(B.DataModel.Instance.enum);a=a.filter(e=>{var e=B.DataModel.Instance.remark[e];return 0<=(null==(e=null==e?void 0:e.generate)?void 0:e.indexOf(this._export.id))});for(let e=0;e{e.annotation&&i.addStr(j.CommonUtils.getCommentStr(this._codeLang,e.annotation,1)+"\n"),j.CommonUtils.numIsInt(+e.value)?i.add(1,e.key+" = "+e.value,!1):i.add(1,`${e.key} = "${e.value}"`,!1),t {0}")}return!0}genItemAndVertical(){var t=j.CommonUtils.getTemplate(this._export,"ConfigItem.txt"),n=j.CommonUtils.getTemplate(this._export,"ConfigSingle.txt");for(let e=0;e "+e+" "+b.TSTypeEnum.Int+" "+a+" -> "+c)),!1;e=_.enum,i.add(1,`readonly ${p}: ${e};`,!1);var u=`import { ${e} } from "./${e}";`;-1==n.content.indexOf(u)&&n.add(0,u)}else if(null!=_&&_.link){u=_.link+B.DataModel.Instance.config.export_item_suffix;if(_.linkIsArray){if(e!=b.TSTypeEnum.IntList&&e!=b.TSTypeEnum.StringList)return console.log(O.default.red("链接的值不是整数数组或字符串数组!-> "+a+" -> "+c)),!1;i.add(1,`readonly ${p}: ${u}[];`,!1)}else i.add(1,`readonly ${p}: ${u};`,!1);_=`import { ${u} } from "./${u}";`;-1==n.content.indexOf(_)&&n.add(0,_)}else i.add(1,`readonly ${p}: ${e};`,!1);t {0}`)}else{let e=new A.CodeWriter;var i=Object.keys(o).length;let t=0;for(const $ in o){var h=B.DataModel.Instance.getConfigKeyType(a,$,this._codeLang),x=r.fields&&r.fields[$],x=(null!=x&&x.annotation&&e.addStr(j.CommonUtils.getCommentStr(this._codeLang,x.annotation,1)+"\n"),F.StrUtils.convertToLowerCamelCase($));e.add(1,`readonly ${x}: ${h};`,!1),t {0}`)}}return!0}genMgr(){var e=j.CommonUtils.getTemplate(this._export,"ConfigMgr.txt");let r=new A.CodeWriter,s=new A.CodeWriter,l=new A.CodeWriter;var d=j.CommonUtils.getTemplate(this._export,"ConfigVar.txt"),f=j.CommonUtils.getTemplate(this._export,"ConfigItemVar.txt");for(let e=0;e();`)):l.add(2,`let map${e} = new Map<${x}, ${_}>();`),l.add(2,"for (let n = 0; n < totalLength; n += nAdd) {"),p?(a.forEach((e,t)=>{e+=B.DataModel.Instance.config.export_item_suffix;l.add(3,`let parentItem${t+1} = this.${n}.get(section[n]) as ${e};`)}),l.add(3,`let item: ${_} = { uniqueKey: parentItem${p}.uniqueKey, `,!1)):l.add(3,`let item: ${_} = { uniqueKey: section[n], `,!1);var $=Object.keys(g.data)[0];isNaN(+$)?b.TSTypeEnum.String:b.TSTypeEnum.Int;if(!c.isSingleMainKey){var y=c.mainKeyNames;for(let e=0;e{var n=B.DataModel.Instance.originConfig[e].fixed_keys;for(let e=0;e(section[n + ${e+t}], this.${v.link})`,!1)}else l.add(0,`${F.StrUtils.convertToLowerCamelCase(I)}: this._${M}.get(section[n + ${e+t}])`,!1)}else l.add(0,`${F.StrUtils.convertToLowerCamelCase(I)}: section[n + ${e+t}]`,!1);e==o.length-1?l.add(0," };"):l.add(0,", ",!1),i=!0}}if(i||l.add(0," };"),p?(l.add(3,`map${e}.data.set(item.uniqueKey, item);`),l.add(3,`map${e}_self.set(item.uniqueKey, item);`)):l.add(3,`map${e}.set(item.uniqueKey, item);`),l.add(2,"}"),p?l.add(2,`this._${u} = new BaseConfig<${x}, ${_}>("${m}", map${e}_self);`):l.add(2,`this._${u} = new BaseConfig<${x}, ${_}>("${m}", map${e});`),!c.isSingleMainKey){s.newLine();var U=c.mainKeyNames,$=B.DataModel.Instance.getConfigCollectionTypeByIndex(m,this._codeLang),D="_"+u+B.DataModel.Instance.config.export_collection_suffix;s.add(0,F.StrUtils.format(f,D,$,m+B.DataModel.Instance.config.export_collection_suffix,$,D)),l.newLine(),l.add(2,`this.${D} = new ${$}();`),l.add(2,`this._${u}.data.forEach(item => {`);for(let n=1;n{l.addStr(F.StrUtils.convertToLowerCamelCase(e)+`: section[${t}]`),t==o.length-1?l.add(0," };"):l.addStr(", ")})}e {0}`),!0}genConfigText(){let n=[];for(let e=0;e{e=isNaN(+e)?e:+e,n.push(e)});for(let e=0;e {0}"),!0}}exports.GenTSModule=t; -------------------------------------------------------------------------------- /Config/Generator/dist/genModules/SheetInfo.js: -------------------------------------------------------------------------------- 1 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0}); -------------------------------------------------------------------------------- /Config/Generator/dist/utils/CodeWriter.js: -------------------------------------------------------------------------------- 1 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CodeWriter=void 0;const t=require("./LineBreak"),n=require("./StrUtils");class e{get lineBreak(){return this._lineBreak}set lineBreak(e){switch(this._lineBreak=e){case t.LineBreak.CRLF:this._lineBreakStr="\r\n";break;case t.LineBreak.LF:this._lineBreakStr="\n"}}get lineBreakStr(){return this._lineBreakStr}get content(){return this._content}get addCount(){return this._addCount}constructor(){this._content="",this._addCount=0,this.lineBreak=t.LineBreak.CRLF}add(e,t,r=1){this._content+=n.StrUtils.getIndentStr(e)+t,"number"==typeof r?0\n";for(let t=0;t";break;case i.CodeLang.TS:l+=a.StrUtils.getIndentStr(r)+"/**\n";for(let t=0;t{var e=path_1.default.join(r,t);const i=fs_1.default.statSync(e);i.isDirectory()?this.findFile(path_1.default.join(r,t),a,l):(t=path_1.default.extname(e),a.length&&-1==a.indexOf(t)||l.push(e))}),l}static findFileByCondition(e,i,r=[]){if(fs_1.default.existsSync(e)){let t=fs_1.default.readdirSync(e);t.forEach(t=>{t=path_1.default.join(e,t);fs_1.default.statSync(t).isDirectory()?this.findFileByCondition(t,i,r):i(t)&&r.push(t)})}}static findDirectory(r,a=[]){const t=fs_1.default.readdirSync(r);return t.forEach(t=>{var e=path_1.default.join(r,t);const i=fs_1.default.statSync(e);i.isDirectory()&&(a.push(e),this.findDirectory(path_1.default.join(r,t),a))}),a}static findDirectoryByCondition(r,a,l=[]){const t=fs_1.default.readdirSync(r);return t.forEach(t=>{var e=path_1.default.join(r,t);const i=fs_1.default.statSync(e);i.isDirectory()&&(a(e)&&l.push(e),this.findDirectory(path_1.default.join(r,t),l))}),l}static deleteFile(t){fs_1.default.existsSync(t)&&fs_1.default.unlinkSync(t)}static deleteFolderFileByCondition(e,i){if(fs_1.default.existsSync(e)){let t=fs_1.default.readdirSync(e);t.forEach(t=>{t=path_1.default.join(e,t);fs_1.default.statSync(t).isDirectory()?this.deleteFolderFileByCondition(t,i):i(t)&&fs_1.default.unlinkSync(t)})}}static deleteFolderFile(e,t=!0){let i=[];fs_1.default.existsSync(e)&&((i=fs_1.default.readdirSync(e)).forEach(t=>{t=e+"/"+t;fs_1.default.statSync(t).isDirectory()?this.deleteFolderFile(t):fs_1.default.unlinkSync(t)}),t&&fs_1.default.rmdirSync(e))}static fileOrFolderIsExsit(t){try{return fs_1.default.accessSync(t),!0}catch(t){return!1}}static getFileMD5(t){if(this.fileOrFolderIsExsit(t))return t=fs_1.default.readFileSync(t,{encoding:"latin1"}),(0,md5_1.default)(enc_latin1_1.default.parse(t)).toString(enc_hex_1.default)}static writeTextFile(writePath,content,lineBreak,succeedLog,failedLog){if(!content)return console.log(cli_color_1.default.yellow("Cannot write null. ->"+writePath));if(null!=lineBreak)switch(lineBreak){case LineBreak_1.LineBreak.CRLF:{let pwd=StrUtils_1.StrUtils.genPassword(8);content=content.replace(/\r\n/g,pwd),content=content.replace(/\n/g,`\r 2 | `),content=content.replace(/\r/g,"");var reg="/"+pwd+"/g";content=content.replace(eval(reg),`\r 3 | `);break}case LineBreak_1.LineBreak.LF:content=content.replace(/\r/g,"")}try{fs_1.default.writeFileSync(writePath,content,{encoding:"utf-8"}),succeedLog&&console.log(cli_color_1.default.green(StrUtils_1.StrUtils.format(succeedLog,writePath)))}catch(error){if(failedLog)console.log(cli_color_1.default.red(StrUtils_1.StrUtils.format(failedLog,writePath,error||"")));else if(null==failedLog)throw error}}static copy(a,l){if(0==fs_1.default.existsSync(a))return!1;if(this.makeDir(l),fs_1.default.statSync(a).isDirectory()){var t=fs_1.default.readdirSync(a);let r=this;t.forEach(function(t){var e=path_1.default.join(a,t),i=fs_1.default.statSync(e);i.isFile()?fs_1.default.copyFileSync(e,path_1.default.join(l,t)):i.isDirectory()&&r.copy(e,path_1.default.join(l,t))})}else{t=path_1.default.basename(a);fs_1.default.copyFileSync(a,path_1.default.join(l,t))}}}exports.IOUtils=IOUtils; -------------------------------------------------------------------------------- /Config/Generator/dist/utils/LineBreak.js: -------------------------------------------------------------------------------- 1 | "use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineBreak=void 0,function(e){e[e.CRLF=0]="CRLF",e[e.LF=1]="LF"}(e=exports.LineBreak||(exports.LineBreak={})); -------------------------------------------------------------------------------- /Config/Generator/dist/utils/StrUtils.js: -------------------------------------------------------------------------------- 1 | "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.StrUtils=void 0;class t{static format(t,...e){if(null!=t&&0{e.push(+t)}),1==e.length?e[0]:e}static convertToLowerCamelCase(t,e=!1){return(e?"_":"")+(t=this.convertToNoUnderline(t))[0].toLowerCase()+t.substring(1,t.length)}static convertToUpperCamelCase(t){return(t=this.convertToNoUnderline(t))[0].toUpperCase()+t.substring(1,t.length)}static convertToNoUnderline(t){var e=t;if(0<=t.indexOf("_")){var e="",r=t.split("_");for(let t=0;t{t.push(+e)}),1==t.length?t[0]:t}static convertToLowerCamelCase(e,t=!1){return(t?"_":"")+(e=this.convertToNoUnderline(e))[0].toLowerCase()+e.substring(1,e.length)}static convertToUpperCamelCase(e){return(e=this.convertToNoUnderline(e))[0].toUpperCase()+e.substring(1,e.length)}static convertToNoUnderline(e){var t=e;if(0<=e.indexOf("_")){var t="",r=e.split("_");for(let e=0;e= 0; n--) { 76 | let jsFile = jsFiles[n]; 77 | let jsCode = fs.readFileSync(jsFile, {encoding: "utf-8"}); 78 | let option = { 79 | mangle: { 80 | toplevel: true, 81 | }, 82 | }; 83 | let result = uglifyjs.minify(jsCode, option); 84 | if (jsCode != result.code) { 85 | IOUtils.writeTextFile(jsFile, result.code); 86 | } else { 87 | break; 88 | } 89 | } 90 | // ---------------------------- ended 丑化编译代码 ---------------------------- 91 | 92 | if (genResult) { 93 | console.log(cli.green("\n<<< 所有配置发布完成!>>>")); 94 | } else { 95 | console.log(cli.yellow("发布配置失败,发布配置过程中出现错误!请向上翻看是否有报错信息。")); 96 | } -------------------------------------------------------------------------------- /Config/Generator/src/Remark.ts: -------------------------------------------------------------------------------- 1 | import {SheetType} from "./SheetType"; 2 | 3 | export interface Remark { 4 | /** 5 | * 文件路径 6 | */ 7 | filePath?: string; 8 | /** 9 | * 文件MD5 10 | */ 11 | fileMD5?: string; 12 | /** 13 | * 配置名称 14 | */ 15 | configName?: string; 16 | /** 17 | * 表类型 18 | */ 19 | sheetType?: SheetType; 20 | /** 21 | * “生成至”数组 22 | */ 23 | generate?: number[]; 24 | /** 25 | * 父表名 26 | */ 27 | parent: string; 28 | /** 29 | * 是否为单主键 30 | */ 31 | isSingleMainKey: boolean; 32 | /** 33 | * 主键只有一个,并且是枚举 34 | */ 35 | mainKeyOnlyOneAndIsEnum: boolean; 36 | /** 37 | * 主键索引数组 38 | */ 39 | mainKeySubs: number[]; 40 | /** 41 | * 主键名称数组 42 | */ 43 | mainKeyNames: string[]; 44 | /** 45 | * 字段。key=字段名,val=字段数据 46 | */ 47 | fields: any; 48 | } -------------------------------------------------------------------------------- /Config/Generator/src/RemarkField.ts: -------------------------------------------------------------------------------- 1 | export interface RemarkField { 2 | /** 3 | * 类型 4 | */ 5 | type?: string; 6 | /** 7 | * “生成至”数组 8 | */ 9 | generate?: number[]; 10 | /** 11 | * 注释 12 | */ 13 | annotation?: string; 14 | /** 15 | * 枚举 16 | */ 17 | enum?: string; 18 | /** 19 | * 链接 20 | */ 21 | link?: string; 22 | /** 23 | * 链接为数组 24 | */ 25 | linkIsArray?: boolean; 26 | } -------------------------------------------------------------------------------- /Config/Generator/src/SheetType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @Doc 表类型 3 | * @Author kL 4 | * @Date 2020/7/18 11:19 5 | */ 6 | export enum SheetType { 7 | /** 8 | * 枚举 9 | */ 10 | Enum = "Enum", 11 | /** 12 | * 横表 13 | */ 14 | Horizontal = "Horizontal", 15 | /** 16 | * 纵表 17 | */ 18 | Vertical = "Vertical", 19 | } -------------------------------------------------------------------------------- /Config/Generator/src/SpecialType.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @Doc 特殊类型 3 | * @Author kL 4 | * @Date 2020/7/22 12:01 5 | */ 6 | export enum SpecialType { 7 | /** 8 | * 数组 9 | */ 10 | Array = "array", 11 | /** 12 | * 枚举 13 | */ 14 | Enum = "enum", 15 | /** 16 | * 连接 17 | */ 18 | Link = "link", 19 | } -------------------------------------------------------------------------------- /Config/Generator/src/TSTypeEnum.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @Doc CS类型枚举 3 | * @Author kL 4 | * @Date 2020/7/12 12:28 5 | */ 6 | export enum TSTypeEnum { 7 | Bool = "boolean", 8 | Int = "number", 9 | String = "string", 10 | Float = "number", 11 | 12 | BoolList = "bool[]", 13 | IntList = "number[]", 14 | StringList = "string[]", 15 | FloatList = "number[]", 16 | 17 | BoolList2 = "bool[][]", 18 | IntList2 = "number[][]", 19 | StringList2 = "string[][]", 20 | FloatList2 = "number[][]", 21 | 22 | BoolList3 = "bool[][][]", 23 | IntList3 = "number[][][]", 24 | StringList3 = "string[][][]", 25 | FloatList3 = "number[][][]", 26 | 27 | BoolList4 = "bool[][][][]", 28 | IntList4 = "number[][][][]", 29 | StringList4 = "string[][][][]", 30 | FloatList4 = "number[][][][]", 31 | 32 | BoolList5 = "bool[][][][][]", 33 | IntList5 = "number[][][][][]", 34 | StringList5 = "string[][][][][]", 35 | FloatList5 = "number[][][][][]", 36 | 37 | Any = "any", 38 | AnyList = "any[]", 39 | } -------------------------------------------------------------------------------- /Config/Generator/src/genModules/SheetInfo.ts: -------------------------------------------------------------------------------- 1 | import {SheetType} from "../SheetType"; 2 | import {Remark} from "../Remark"; 3 | 4 | export interface SheetInfo { 5 | /** 6 | * 文件路径 7 | */ 8 | filePath?: string; 9 | /** 10 | * 文件MD5 11 | */ 12 | fileMD5?: string; 13 | /** 14 | * 表类型 15 | */ 16 | sheetType?: SheetType; 17 | /** 18 | * 表原始数据 19 | */ 20 | sheetSourceData?: any[][]; 21 | /** 22 | * 表内容 23 | */ 24 | sheetContent?: any[]; 25 | /** 26 | * 表名 27 | */ 28 | sheetName?: string; 29 | /** 30 | * 表明(大写) 31 | */ 32 | sheetNameUppercase?: string; 33 | /** 34 | * 父表名 35 | */ 36 | parent?: string; 37 | /** 38 | * 字段名称数组 39 | */ 40 | keyNames?: string[]; 41 | /** 42 | * 字段类型数组。key=字段名,value=类型 43 | */ 44 | fixedKeyTypes?: any; 45 | /** 46 | * 格式数组 47 | */ 48 | formats?: any[]; 49 | /** 50 | * “生成至”数组 | “生成至”字典 51 | */ 52 | gens?: any[] | {}; 53 | /** 54 | * 默认值数组 55 | */ 56 | defaults?: any[]; 57 | /** 58 | * 注释数组 | 注释字典 59 | */ 60 | annotations?: string[] | {}; 61 | /** 62 | * 主键索引数组 63 | */ 64 | mainKeySubs?: number[]; 65 | /** 66 | * 主键名称数组 67 | */ 68 | mainKeyNames?: string[]; 69 | /** 70 | * 所有数组列数数组 71 | */ 72 | arrayColAll?: number[]; 73 | /** 74 | * 数组列字典。key=字段名,value={ cols(列索引数组) } 75 | */ 76 | arrayColDict?: any; 77 | /** 78 | * 连接字典。key=字段名,value={ link(连接表名), isArray(是否为数组) } 79 | */ 80 | linkDict?: any; 81 | /** 82 | * 字段数据。key=字段名,value=值 83 | */ 84 | fixedKeyDatas?: {}; 85 | /** 86 | * 是否为单主键 87 | */ 88 | isSingleMainKey?: boolean; 89 | /** 90 | * 主键只有一个,并且是枚举 91 | */ 92 | mainKeyOnlyOneAndIsEnum?: boolean; 93 | /** 94 | * 是否使用老数据 95 | */ 96 | isUseOldData?: boolean; 97 | /** 98 | * 老数据(缓存) 99 | */ 100 | oldData?: any; 101 | /** 102 | * 老Remark数据 103 | */ 104 | oldRemarkData?: Remark; 105 | 106 | /** 107 | * 数据字典 108 | */ 109 | dict?: any; 110 | /** 111 | * 优化的数据字典 112 | */ 113 | optimizedDict?: any; 114 | } -------------------------------------------------------------------------------- /Config/Generator/src/utils/CodeWriter.ts: -------------------------------------------------------------------------------- 1 | import {LineBreak} from "./LineBreak"; 2 | import {StrUtils} from "./StrUtils"; 3 | 4 | export class CodeWriter { 5 | private _lineBreak: LineBreak; 6 | public get lineBreak() { 7 | return this._lineBreak; 8 | } 9 | 10 | public set lineBreak(value: LineBreak) { 11 | this._lineBreak = value; 12 | switch (value) { 13 | case LineBreak.CRLF: { 14 | this._lineBreakStr = "\r\n"; 15 | break; 16 | } 17 | case LineBreak.LF: { 18 | this._lineBreakStr = "\n"; 19 | break; 20 | } 21 | } 22 | } 23 | 24 | private _lineBreakStr: string; 25 | public get lineBreakStr() { 26 | return this._lineBreakStr; 27 | } 28 | 29 | private _content: string = ""; 30 | public get content() { 31 | return this._content; 32 | } 33 | 34 | private _addCount: number = 0; 35 | public get addCount() { 36 | return this._addCount; 37 | } 38 | 39 | constructor() { 40 | this.lineBreak = LineBreak.CRLF; 41 | } 42 | 43 | public add(indent: number, str: string, newLine: number | boolean = 1) { 44 | this._content += StrUtils.getIndentStr(indent) + str; 45 | 46 | if (typeof newLine == "number") { 47 | if (newLine > 0) { 48 | this.newLine(newLine); 49 | } 50 | } else if (newLine === true) { 51 | this.newLine(1); 52 | } 53 | 54 | this._addCount++; 55 | } 56 | 57 | public addStr(str: string) { 58 | this._content += str; 59 | } 60 | 61 | public newLine(num: number = 1) { 62 | while (num > 0) { 63 | this._content += this._lineBreakStr; 64 | num--; 65 | } 66 | } 67 | 68 | public clear() { 69 | this._content = ""; 70 | this._addCount = 0; 71 | } 72 | } -------------------------------------------------------------------------------- /Config/Generator/src/utils/CommonUtils.ts: -------------------------------------------------------------------------------- 1 | import fs from "fs"; 2 | import {IOUtils} from "./IOUtils"; 3 | import cli from "cli-color"; 4 | import {StrUtils} from "./StrUtils"; 5 | import {CodeLang} from "../CodeLang"; 6 | import {DataModel} from "../DataModel"; 7 | import {IConfigExport} from "../IConfigExport"; 8 | 9 | /** 10 | * @Doc 通用工具 11 | * @Author kL 12 | * @Date 2019/3/17 20:13 13 | */ 14 | export class CommonUtils { 15 | 16 | /** 17 | * 获取模板 18 | * @param exportID 19 | * @param filename 20 | * @returns 21 | */ 22 | public static getTemplate(expt: IConfigExport, filename: string) { 23 | let url = `templates/${expt.template_name || expt.id}/template/${filename}`; 24 | if (IOUtils.fileOrFolderIsExsit(url)) { 25 | return fs.readFileSync(url, "utf-8"); 26 | } 27 | console.log(cli.red(`找不到模板文件!${url}`)); 28 | } 29 | 30 | /** 31 | * 判断数字是否为整数 32 | * @param {string|int} param 33 | * @returns 34 | */ 35 | public static numIsInt(param) { 36 | if (param === "" || isNaN(param)) 37 | return false; 38 | return parseInt(param) == parseFloat(param); 39 | } 40 | 41 | /** 42 | * 判断数字是否为浮点数 43 | * @param {string|int} param 44 | * @returns 45 | */ 46 | public static numIsFloat(param) { 47 | if (param === "" || isNaN(param)) 48 | return false; 49 | return parseInt(param) != parseFloat(param); 50 | } 51 | 52 | /** 53 | * 深度复制 54 | * @param object 55 | */ 56 | public static deepClone(object: any): any { 57 | if (object instanceof Array) { 58 | let array: any[] = []; 59 | let len = object.length; 60 | for (let n = 0; n < len; n++) { 61 | array.push(this.deepClone(object[n])); 62 | } 63 | return array; 64 | } else if (object instanceof Object) { 65 | let obj = {}; 66 | for (let fieldKey in object) { 67 | if (object.hasOwnProperty(fieldKey)) { 68 | obj[fieldKey] = this.deepClone(object[fieldKey]); 69 | } 70 | } 71 | return obj; 72 | } else { 73 | return object; 74 | } 75 | } 76 | 77 | /** 78 | * 转换字符串为对象 79 | * @param str 80 | * @param tidy 81 | * @returns 82 | */ 83 | public static convertStringToObj(str: string, tidy?: boolean): { 84 | obj: any, 85 | isString: boolean, 86 | mayBeArray?: boolean, 87 | mayBeObj?: boolean 88 | } { 89 | let result: any = {}; 90 | 91 | let obj: any; 92 | let suc = false; 93 | 94 | if (tidy && str && str.replace) { 95 | str = str.replace(/\t/g, '').replace(/\r/g, '').replace(/\n/g, ''); 96 | } 97 | 98 | try { 99 | obj = JSON.parse(str); 100 | suc = true; 101 | } catch (err) { 102 | 103 | } 104 | 105 | result.obj = suc ? obj : str; 106 | result.isString = typeof result.obj == "string"; 107 | 108 | // if (!suc && result.isString) { 109 | // let a = StringUtils.getStrCharNum(str, "["); 110 | // let b = StringUtils.getStrCharNum(str, "]"); 111 | // if (a >= 2 && b >= 2) { 112 | // result.mayBeArray = true; 113 | // } 114 | 115 | // a = StringUtils.getStrCharNum(str, "{"); 116 | // b = StringUtils.getStrCharNum(str, "}"); 117 | // let c = StringUtils.getStrCharNum(str, ":"); 118 | // if (a >= 1 && b >= 1 && c >= 1) { 119 | // result.mayBeObj = true; 120 | // } 121 | // } 122 | 123 | return result; 124 | } 125 | 126 | /** 127 | * 获取注释字符串 128 | * @param codeLang 129 | * @param str 130 | * @param indent 131 | * @param tab 132 | * @returns 133 | */ 134 | public static getCommentStr(codeLang: CodeLang, str: string, indent = 0, tab?: boolean) { 135 | if (str == null) 136 | return ""; 137 | if (typeof str != "string") 138 | str = str + ""; 139 | str.replace(/\r/, ""); 140 | let lines = str.split("\n"); 141 | let result = ""; 142 | switch (codeLang) { 143 | case CodeLang.CS: 144 | case CodeLang.ETCS: { 145 | result += StrUtils.getIndentStr(indent) + "/// \n"; 146 | for (let n = 0; n < lines.length; n++) { 147 | result += StrUtils.getIndentStr(indent) + "/// " + lines[n] + "\n"; 148 | } 149 | result += StrUtils.getIndentStr(indent, tab) + "/// "; 150 | break; 151 | } 152 | case CodeLang.TS: { 153 | result += StrUtils.getIndentStr(indent) + "/**\n"; 154 | for (let n = 0; n < lines.length; n++) { 155 | result += StrUtils.getIndentStr(indent) + " * " + lines[n] + "\n"; 156 | } 157 | result += StrUtils.getIndentStr(indent, tab) + " */"; 158 | break; 159 | } 160 | } 161 | 162 | return result; 163 | } 164 | } 165 | 166 | -------------------------------------------------------------------------------- /Config/Generator/src/utils/IOUtils.ts: -------------------------------------------------------------------------------- 1 | import cli from "cli-color"; 2 | import fs from "fs"; 3 | import path from "path"; 4 | import { StrUtils } from "./StrUtils"; 5 | import EncLatin1 from "crypto-js/enc-latin1"; 6 | import EncHex from "crypto-js/enc-hex"; 7 | import MD5 from "crypto-js/md5"; 8 | import { LineBreak } from "./LineBreak"; 9 | 10 | /** 11 | * @Doc 通用工具 12 | * @Author kL 13 | * @Date 2019/3/19 10:59 14 | */ 15 | export class IOUtils { 16 | /** 17 | * 创建路径 18 | * 使用示例:utility.makeDir(path.join(__dirname, './mkdir/demo/test/')); 19 | * @param {string} dir 路径 20 | * @param {function} cb 回调 21 | */ 22 | public static makeDir(dir: string) { 23 | if (fs.existsSync(dir)) { 24 | return true; 25 | } else { 26 | if (this.makeDir(path.dirname(dir))) { 27 | fs.mkdirSync(dir); 28 | return true; 29 | } 30 | } 31 | } 32 | 33 | /** 34 | * 递归文件夹获取指定类型文件 35 | * @param {string} dir 路径 36 | * @param {array} [exts=[]] 扩展名 37 | * @param {array} [filesList=[]] 文件列表 38 | * @returns 39 | */ 40 | public static findFile(dir: string, exts: string[] = [], filesList: string[] = []) { 41 | const files = fs.readdirSync(dir); 42 | files.forEach(item => { 43 | var fullPath = path.join(dir, item); 44 | const stat = fs.statSync(fullPath); 45 | if (stat.isDirectory()) { 46 | this.findFile(path.join(dir, item), exts, filesList); 47 | } else { 48 | let extName: string = path.extname(fullPath); 49 | if (!exts.length || exts.indexOf(extName) != -1) { 50 | filesList.push(fullPath); 51 | } 52 | } 53 | }); 54 | return filesList; 55 | } 56 | 57 | /** 58 | * 按条件递归文件夹获取文件 59 | * @param {string} folderPath 文件夹路径 60 | * @param {function} condition 条件 61 | * @param {array} filesList 文件列表 62 | */ 63 | public static findFileByCondition(folderPath: string, condition: Function, filesList: string[] = []) { 64 | if (fs.existsSync(folderPath)) { // 如果存在路径 65 | let files = fs.readdirSync(folderPath); // 读取目录下所有文件 66 | files.forEach(filename => { 67 | let fullPath = path.join(folderPath, filename); 68 | // 如果是文件夹 69 | if (fs.statSync(fullPath).isDirectory()) { 70 | this.findFileByCondition(fullPath, condition, filesList); // 递归 71 | } else { 72 | // 如果条件符合 73 | if (condition(fullPath)) { 74 | filesList.push(fullPath); 75 | } 76 | } 77 | }); 78 | } 79 | } 80 | 81 | /** 82 | * 递归文件夹获取文件夹 83 | * @param {string} dir 路径 84 | * @param {array} [dirList=[]] 文件列表 85 | * @returns 86 | */ 87 | public static findDirectory(dir: string, dirList: string[] = []) { 88 | const files = fs.readdirSync(dir); 89 | files.forEach(item => { 90 | let fullPath = path.join(dir, item); 91 | const stat = fs.statSync(fullPath); 92 | if (stat.isDirectory()) { 93 | dirList.push(fullPath); 94 | this.findDirectory(path.join(dir, item), dirList); 95 | } 96 | }); 97 | return dirList; 98 | } 99 | 100 | /** 101 | * 按条件递归文件夹获取文件夹 102 | * @param {string} dir 路径 103 | * @param {function} condition 条件 104 | * @param {array} [dirList=[]] 文件列表 105 | * @returns 106 | */ 107 | public static findDirectoryByCondition(dir: string, condition: Function, dirList: string[] = []) { 108 | const files = fs.readdirSync(dir); 109 | files.forEach(item => { 110 | var fullPath = path.join(dir, item); 111 | const stat = fs.statSync(fullPath); 112 | if (stat.isDirectory()) { 113 | if (condition(fullPath)) { 114 | dirList.push(fullPath); 115 | } 116 | this.findDirectory(path.join(dir, item), dirList); 117 | } 118 | }); 119 | return dirList; 120 | } 121 | 122 | /** 123 | * 删除文件 124 | * @param path 文件路径 125 | */ 126 | public static deleteFile(path: string) { 127 | if (fs.existsSync(path)) { // 如果存在路径 128 | fs.unlinkSync(path); // 删除文件 129 | } 130 | } 131 | 132 | /** 133 | * 按条件递归删除指定目录下的所有文件 134 | * @param {string} folderPath 文件夹路径 135 | * @param {条件} condition 条件 136 | */ 137 | public static deleteFolderFileByCondition(folderPath: string, condition: Function) { 138 | if (fs.existsSync(folderPath)) { // 如果存在路径 139 | let files = fs.readdirSync(folderPath); // 读取目录下所有文件 140 | files.forEach(filename => { 141 | let fullPath = path.join(folderPath, filename); 142 | // 如果是文件夹 143 | if (fs.statSync(fullPath).isDirectory()) { 144 | this.deleteFolderFileByCondition(fullPath, condition); // 递归 145 | } else { 146 | // 如果条件符合 147 | if (condition(fullPath)) { 148 | fs.unlinkSync(fullPath); // 删除文件 149 | } 150 | } 151 | }); 152 | } 153 | } 154 | 155 | /** 156 | * 递归删除指定目录下的所有文件 157 | * @param {string} folderPath 文件夹路径 158 | * @param {boolean} delRootDir 是否删除根目录 159 | */ 160 | public static deleteFolderFile(folderPath: string, delRootDir = true) { 161 | let files = []; 162 | if (fs.existsSync(folderPath)) { // 如果存在路径 163 | files = fs.readdirSync(folderPath); // 读取目录下所有文件 164 | files.forEach(file => { 165 | let curPath = folderPath + "/" + file; 166 | if (fs.statSync(curPath).isDirectory()) { // 如果是文件夹 167 | this.deleteFolderFile(curPath); // 递归删除 168 | } else { 169 | fs.unlinkSync(curPath); // 删除文件 170 | } 171 | }); 172 | if (delRootDir) { 173 | fs.rmdirSync(folderPath); // 删除文件夹本身 174 | } 175 | } 176 | } 177 | 178 | /** 179 | * 判断文件(夹)是否存在 180 | * @param path 181 | */ 182 | public static fileOrFolderIsExsit(path: string) { 183 | try { 184 | fs.accessSync(path); 185 | return true; 186 | } catch (e) { 187 | // 文件不存在 188 | return false; 189 | } 190 | } 191 | 192 | /** 193 | * 获取文件MD5 194 | * @param filePath 195 | */ 196 | public static getFileMD5(filePath: string) { 197 | if (this.fileOrFolderIsExsit(filePath)) { 198 | let content = fs.readFileSync(filePath, { encoding: "latin1" }); 199 | return MD5(EncLatin1.parse(content)).toString(EncHex); 200 | } 201 | } 202 | 203 | /** 204 | * 写入文件 205 | * @param {string} writePath 写入路径 206 | * @param {*} content 内容 207 | * @param {string} succeedLog 成功文本 208 | * @param {string} failedLog 失败文本 209 | * @returns 210 | */ 211 | public static writeTextFile(writePath: string, content: string, lineBreak?: LineBreak, succeedLog?: string, failedLog?: string) { 212 | if (!content) { 213 | return console.log(cli.yellow(`Cannot write null. ->${writePath}`)); 214 | } 215 | // 换行符转换 216 | if (lineBreak != null) { 217 | switch (lineBreak) { 218 | case LineBreak.CRLF: { 219 | let pwd = StrUtils.genPassword(8); 220 | content = content.replace(/\r\n/g, pwd); 221 | content = content.replace(/\n/g, `\r\n`); 222 | content = content.replace(/\r/g, ``); 223 | var reg = "/" + pwd + "/g"; 224 | content = content.replace(eval(reg), `\r\n`); 225 | break; 226 | } 227 | case LineBreak.LF: { 228 | content = content.replace(/\r/g, ``); 229 | break; 230 | } 231 | } 232 | } 233 | try { 234 | fs.writeFileSync( 235 | writePath, 236 | content, 237 | { 238 | encoding: "utf-8" 239 | } 240 | ); 241 | if (succeedLog) { 242 | console.log(cli.green(StrUtils.format(succeedLog, writePath))); 243 | } 244 | } catch (error) { 245 | if (failedLog) { 246 | console.log(cli.red(StrUtils.format(failedLog, writePath, error || ""))); 247 | } else if (failedLog == null) { 248 | throw error; 249 | } 250 | } 251 | } 252 | 253 | /** 254 | * 复制 255 | * @param {string} from 256 | * @param {string} to 257 | */ 258 | public static copy(from: string, to: string) { 259 | if (fs.existsSync(from) == false) 260 | return false; 261 | 262 | this.makeDir(to); 263 | 264 | if (fs.statSync(from).isDirectory()) { 265 | // 拷贝新的内容进去 266 | var dirs = fs.readdirSync(from); 267 | let self = this; 268 | dirs.forEach(function (item) { 269 | var item_path = path.join(from, item); 270 | var temp = fs.statSync(item_path); 271 | if (temp.isFile()) { // 是文件 272 | fs.copyFileSync(item_path, path.join(to, item)); 273 | } else if (temp.isDirectory()) { // 是目录 274 | self.copy(item_path, path.join(to, item)); 275 | } 276 | }); 277 | } else { 278 | var item = path.basename(from); 279 | fs.copyFileSync(from, path.join(to, item)); 280 | } 281 | } 282 | } -------------------------------------------------------------------------------- /Config/Generator/src/utils/LineBreak.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @Doc 换行枚举 3 | * @Author kL 4 | * @Date 2019/5/28 17:42 5 | */ 6 | export enum LineBreak { 7 | CRLF, 8 | LF, 9 | } -------------------------------------------------------------------------------- /Config/Generator/src/utils/StrUtils.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @Doc 字符串工具 3 | * @Author kL 4 | * @Date 2019/3/19 15:07 5 | */ 6 | export class StrUtils { 7 | /** 8 | * 字符串格式化 9 | * 使用示例1:utility.format("{0}击杀了{1}", "A玩家", "B玩家"); // A玩家击杀了B玩家 10 | * 使用示例2:utility.format("{0}击杀了{1}", ["A玩家", "B玩家"]); // A玩家击杀了B玩家 11 | * @param {string} pattern 模板 12 | * @param {*} args 参数 13 | * @returns 14 | */ 15 | public static format(pattern: string, ...args: any[]) { 16 | if (pattern == void 0) return ''; 17 | if (arguments.length > 0) { 18 | if (arguments.length == 1) { 19 | return pattern; 20 | } else if (arguments.length == 2 && typeof (args) == "object") { 21 | if (!args) return ''; 22 | for (var i = 0; i < args.length; i++) { 23 | if (args[i] != null) { 24 | var reg = new RegExp("([【{]" + (i) + "[】}])", "g"); 25 | pattern = pattern.replace(reg, args[i].toString()); 26 | } 27 | } 28 | } else { 29 | for (var i = 1; i < arguments.length; i++) { 30 | if (arguments[i] != null) { 31 | var reg = new RegExp("([【{]" + (i - 1) + "[】}])", "g"); 32 | pattern = pattern.replace(reg, arguments[i].toString()); 33 | } 34 | } 35 | } 36 | return pattern; 37 | } else { 38 | return ""; 39 | } 40 | } 41 | 42 | /** 43 | * 获取字符串中的整型数字(int) 44 | * 使用示例:utility.getStrNum("如果有3个苹果,要怎样分给5个人吃呢?"); // [3, 5]; 45 | * @param {string} str 46 | * @returns 47 | */ 48 | public static getStrNum(str: string) { 49 | let result: number[] = []; 50 | let matchs: string[] = str.match(/\d+/g) as string[]; 51 | if (matchs) { 52 | matchs.forEach(val => { 53 | result.push(+val); 54 | }); 55 | return result.length == 1 ? result[0] : result; 56 | } 57 | } 58 | 59 | /** 60 | * 转换到小驼峰命名 61 | * @param str 62 | * @param withUnderline 是否携带下划线 63 | * @returns 64 | */ 65 | public static convertToLowerCamelCase(str: string, withUnderline: boolean = false) { 66 | str = this.convertToNoUnderline(str); 67 | return (withUnderline ? "_" : "") + str[0].toLowerCase() + str.substring(1, str.length); 68 | } 69 | 70 | /** 71 | * 转换到大驼峰命名 72 | * @param {string} str 73 | * @returns 74 | */ 75 | public static convertToUpperCamelCase(str) { 76 | str = this.convertToNoUnderline(str); 77 | return str[0].toUpperCase() + str.substring(1, str.length); 78 | } 79 | 80 | /** 81 | * 转换成无下划线命名 82 | * @param {string} str 83 | * @returns 84 | */ 85 | public static convertToNoUnderline(str) { 86 | var result = str; 87 | if (str.indexOf("_") >= 0) { 88 | result = ""; 89 | var clips = str.split("_"); 90 | for (let n = 0; n < clips.length; n++) { 91 | var clip = clips[n]; 92 | if (n > 0) { 93 | result += clip[0].toUpperCase() + clip.substring(1, clip.length); 94 | } else { 95 | result += clip; 96 | } 97 | } 98 | } 99 | return result; 100 | } 101 | 102 | /** 103 | * 获取字符串中某字符的个数 104 | * @param str 105 | * @param char 106 | * @returns 107 | */ 108 | public static getStrCharNum(str: string, char: string) { 109 | let result = 0; 110 | if (str) { 111 | for (let n = str.length - 1; n >= 0; n--) { 112 | if (str[n] == char) 113 | result++; 114 | } 115 | } 116 | return result; 117 | } 118 | 119 | /** 120 | * 生成密码字符串 121 | * 33~47:!~/ 122 | * 48~57:0~9 123 | * 58~64::~@ 124 | * 65~90:A~Z 125 | * 91~96:[~` 126 | * 97~122:a~z 127 | * 123~127:{~ 128 | * @param length 长度 129 | * @param hasNum 是否包含数字 1-包含 0-不包含 130 | * @param hasChar 是否包含字母 1-包含 0-不包含 131 | * @param hasSymbol 是否包含其他符号 1-包含 0-不包含 132 | * @param caseSense 是否大小写敏感 1-敏感 0-不敏感 133 | * @param lowerCase 是否只需要小写,只有当hasChar为0且caseSense为1时起作用 1-全部小写 0-全部大写 134 | */ 135 | public static genPassword(length: number = 8, hasNum: boolean = true, hasChar: boolean = true, hasSymbol: boolean = false, caseSense: boolean = true, lowerCase: boolean = false) { 136 | var m = ""; 137 | if (!hasNum && !hasChar && !hasSymbol) 138 | return m; 139 | for (var i = length; i >= 0; i--) { 140 | var num = Math.floor((Math.random() * 94) + 33); 141 | if ( 142 | ( 143 | (!hasNum) && ((num >= 48) && (num <= 57)) 144 | ) || ( 145 | (!hasChar) && (( 146 | (num >= 65) && (num <= 90) 147 | ) || ( 148 | (num >= 97) && (num <= 122) 149 | )) 150 | ) || ( 151 | (!hasSymbol) && (( 152 | (num >= 33) && (num <= 47) 153 | ) || ( 154 | (num >= 58) && (num <= 64) 155 | ) || ( 156 | (num >= 91) && (num <= 96) 157 | ) || ( 158 | (num >= 123) && (num <= 127) 159 | )) 160 | ) 161 | ) { 162 | i++; 163 | continue; 164 | } 165 | m += String.fromCharCode(num); 166 | } 167 | if (caseSense != null && !caseSense) { 168 | m = (!lowerCase) ? m.toUpperCase() : m.toLowerCase(); 169 | } 170 | return m; 171 | } 172 | 173 | /** 174 | * 获取缩进字符串 175 | * @param indent 176 | * @param tab 177 | */ 178 | public static getIndentStr(indent: number, tab?: boolean) { 179 | let result = ""; 180 | for (let n = 0; n < indent; n++) { 181 | result += tab ? "\t" : " "; 182 | } 183 | return result; 184 | } 185 | } -------------------------------------------------------------------------------- /Config/Generator/src/utils/StringUtils.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @Doc 通用工具 3 | * @Author kL 4 | * @Date 2019/3/19 15:07 5 | */ 6 | export class StringUtils { 7 | /** 8 | * 字符串格式化 9 | * 使用示例1:utility.format("{0}击杀了{1}", "A玩家", "B玩家"); // A玩家击杀了B玩家 10 | * 使用示例2:utility.format("{0}击杀了{1}", ["A玩家", "B玩家"]); // A玩家击杀了B玩家 11 | * @param {string} pattern 模板 12 | * @param {*} args 参数 13 | * @returns 14 | */ 15 | public static format(pattern: string, ...args: any[]) { 16 | if (pattern == void 0) return ''; 17 | if (arguments.length > 0) { 18 | if (arguments.length == 1) { 19 | return pattern; 20 | } else if (arguments.length == 2 && typeof (args) == "object") { 21 | if (!args) return ''; 22 | for (var i = 0; i < args.length; i++) { 23 | if (args[i] != null) { 24 | var reg = new RegExp("([【{]" + (i) + "[】}])", "g"); 25 | pattern = pattern.replace(reg, args[i].toString()); 26 | } 27 | } 28 | } else { 29 | for (var i = 1; i < arguments.length; i++) { 30 | if (arguments[i] != null) { 31 | var reg = new RegExp("([【{]" + (i - 1) + "[】}])", "g"); 32 | pattern = pattern.replace(reg, arguments[i].toString()); 33 | } 34 | } 35 | } 36 | return pattern; 37 | } else { 38 | return ""; 39 | } 40 | } 41 | 42 | /** 43 | * 获取字符串中的整型数字(int) 44 | * 使用示例:utility.getStrNum("如果有3个苹果,要怎样分给5个人吃呢?"); // [3, 5]; 45 | * @param {string} str 46 | * @returns 47 | */ 48 | public static getStrNum(str: string) { 49 | let result: number[] = []; 50 | let matchs: string[] = str.match(/\d+/g) as string[]; 51 | if (matchs) { 52 | matchs.forEach(val => { 53 | result.push(+val); 54 | }); 55 | return result.length == 1 ? result[0] : result; 56 | } 57 | } 58 | 59 | /** 60 | * 转换到小驼峰命名 61 | * @param str 62 | * @param withUnderline 是否携带下划线 63 | * @returns 64 | */ 65 | public static convertToLowerCamelCase(str: string, withUnderline: boolean = false) { 66 | str = this.convertToNoUnderline(str); 67 | return (withUnderline ? "_" : "") + str[0].toLowerCase() + str.substring(1, str.length); 68 | } 69 | 70 | /** 71 | * 转换到大驼峰命名 72 | * @param {string} str 73 | * @returns 74 | */ 75 | public static convertToUpperCamelCase(str) { 76 | str = this.convertToNoUnderline(str); 77 | return str[0].toUpperCase() + str.substring(1, str.length); 78 | } 79 | 80 | /** 81 | * 转换成无下划线命名 82 | * @param {string} str 83 | * @returns 84 | */ 85 | public static convertToNoUnderline(str) { 86 | var result = str; 87 | if (str.indexOf("_") >= 0) { 88 | result = ""; 89 | var clips = str.split("_"); 90 | for (let n = 0; n < clips.length; n++) { 91 | var clip = clips[n]; 92 | if (n > 0) { 93 | result += clip[0].toUpperCase() + clip.substring(1, clip.length); 94 | } else { 95 | result += clip; 96 | } 97 | } 98 | } 99 | return result; 100 | } 101 | 102 | /** 103 | * 生成密码字符串 104 | * 33~47:!~/ 105 | * 48~57:0~9 106 | * 58~64::~@ 107 | * 65~90:A~Z 108 | * 91~96:[~` 109 | * 97~122:a~z 110 | * 123~127:{~ 111 | * @param length 长度 112 | * @param hasNum 是否包含数字 1-包含 0-不包含 113 | * @param hasChar 是否包含字母 1-包含 0-不包含 114 | * @param hasSymbol 是否包含其他符号 1-包含 0-不包含 115 | * @param caseSense 是否大小写敏感 1-敏感 0-不敏感 116 | * @param lowerCase 是否只需要小写,只有当hasChar为0且caseSense为1时起作用 1-全部小写 0-全部大写 117 | */ 118 | public static genPassword(length: number = 8, hasNum: boolean = true, hasChar: boolean = true, hasSymbol: boolean = false, caseSense: boolean = true, lowerCase: boolean = false) { 119 | var m = ""; 120 | if (!hasNum && !hasChar && !hasSymbol) 121 | return m; 122 | for (var i = length; i >= 0; i--) { 123 | var num = Math.floor((Math.random() * 94) + 33); 124 | if ( 125 | ( 126 | (!hasNum) && ((num >= 48) && (num <= 57)) 127 | ) || ( 128 | (!hasChar) && (( 129 | (num >= 65) && (num <= 90) 130 | ) || ( 131 | (num >= 97) && (num <= 122) 132 | )) 133 | ) || ( 134 | (!hasSymbol) && (( 135 | (num >= 33) && (num <= 47) 136 | ) || ( 137 | (num >= 58) && (num <= 64) 138 | ) || ( 139 | (num >= 91) && (num <= 96) 140 | ) || ( 141 | (num >= 123) && (num <= 127) 142 | )) 143 | ) 144 | ) { 145 | i++; 146 | continue; 147 | } 148 | m += String.fromCharCode(num); 149 | } 150 | if (caseSense != null && !caseSense) { 151 | m = (!lowerCase) ? m.toUpperCase() : m.toLowerCase(); 152 | } 153 | return m; 154 | } 155 | } -------------------------------------------------------------------------------- /Config/Generator/templates/1/scripts/BaseConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace GameConfig 5 | { 6 | public class BaseConfig 7 | { 8 | public string ConfigName { get; private set; } 9 | 10 | public IReadOnlyDictionary Data { private set; get; } 11 | 12 | public BaseConfig(string configName, IReadOnlyDictionary data) 13 | { 14 | ConfigName = configName; 15 | Data = data; 16 | } 17 | 18 | public W Get(T key) 19 | { 20 | Data.TryGetValue(key, out var result); 21 | return result; 22 | } 23 | 24 | public W Get(T key, bool ifNullThrowException) 25 | { 26 | if (ifNullThrowException) 27 | { 28 | if (!Data.ContainsKey(key)) 29 | throw new Exception($"{ConfigName} not found => {key}"); 30 | } 31 | 32 | Data.TryGetValue(key, out var result); 33 | return result; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /Config/Generator/templates/1/template/ConfigEnum.txt: -------------------------------------------------------------------------------- 1 | namespace GameConfig 2 | { 3 | public enum {0} 4 | { 5 | {1} 6 | } 7 | } -------------------------------------------------------------------------------- /Config/Generator/templates/1/template/ConfigItem.txt: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace GameConfig 4 | { 5 | public class {0}{1} 6 | { 7 | {2} 8 | 9 | public {3}({4}){5} 10 | { 11 | {6} 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Config/Generator/templates/1/template/ConfigMgr.txt: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Text.RegularExpressions; 3 | using UnityEngine; 4 | 5 | namespace GameConfig 6 | { 7 | public static class ConfigMgr 8 | { 9 | {0} 10 | 11 | public static void Init(string configPath) 12 | { 13 | var textAsset = Resources.Load(configPath) as TextAsset; 14 | var configText = ConfigUtility.DecodeBase64(textAsset.text); 15 | Parse(configText); 16 | } 17 | 18 | public static void Parse(string configText) 19 | { 20 | var sections = configText.Split("#"[0]); 21 | 22 | string section; 23 | string[] lines; 24 | 25 | {1} 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /Config/Generator/templates/1/template/ConfigSingle.txt: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace GameConfig 4 | { 5 | public class {0} 6 | { 7 | public string ConfigName { get; private set; } 8 | {1} 9 | 10 | public {2}(string configName, {3}) 11 | { 12 | ConfigName = configName; 13 | {4} 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Config/Generator/templates/2/scripts/BaseConfig.ts: -------------------------------------------------------------------------------- 1 | export class BaseConfig { 2 | private _configName: string; 3 | public get configName() { 4 | return this._configName; 5 | } 6 | 7 | private _data: Map; 8 | public get data(): Map { 9 | return this._data; 10 | }; 11 | 12 | constructor(configName: string, sourceData: Map) { 13 | this._configName = configName; 14 | this._data = sourceData; 15 | } 16 | 17 | public get(key: T, ifNullThrowError: boolean = false): W { 18 | if (ifNullThrowError) { 19 | if (!this._data.has(key)) 20 | console.error(`${this._configName} not found => ${key}`); 21 | } 22 | return this._data.get(key); 23 | } 24 | } -------------------------------------------------------------------------------- /Config/Generator/templates/2/template/ConfigEnum.txt: -------------------------------------------------------------------------------- 1 | export enum {0} { 2 | {1} 3 | } -------------------------------------------------------------------------------- /Config/Generator/templates/2/template/ConfigItem.txt: -------------------------------------------------------------------------------- 1 | {0}export interface {1} { 2 | {2} 3 | } -------------------------------------------------------------------------------- /Config/Generator/templates/2/template/ConfigItemVar.txt: -------------------------------------------------------------------------------- 1 | private static {0}: {1}; 2 | public static get {2}(): {3} { return this.{4}; }; -------------------------------------------------------------------------------- /Config/Generator/templates/2/template/ConfigMgr.txt: -------------------------------------------------------------------------------- 1 | import { BaseConfig } from "./BaseConfig"; 2 | import { JsonAsset, resources } from "cc"; 3 | {0} 4 | export class ConfigMgr { 5 | {1} 6 | public static init(path: string, thisObj?: any, completeCallback?: Function) { 7 | let self = this; 8 | resources.load("config/config", JsonAsset, (err, asset) => { 9 | console.log(asset); 10 | self.parse(asset.json as any); 11 | if (thisObj && completeCallback) { 12 | completeCallback.call(thisObj); 13 | } 14 | }); 15 | } 16 | 17 | public static parse(data: any[]) { 18 | let pwd = "{2}"; 19 | 20 | let totalLength = data.length; 21 | let totalLengthLow = totalLength - 1; 22 | let sections: any[][] = []; 23 | let section: any[] = []; 24 | for (let n = 0; n < totalLength; n++) { 25 | let value = data[n]; 26 | if (n == totalLengthLow) { 27 | section.push(value); 28 | sections.push(section); 29 | } else if (pwd == value) { 30 | sections.push(section); 31 | section = []; 32 | } else { 33 | section.push(value); 34 | } 35 | } 36 | let nAdd: number; 37 | 38 | {3} 39 | } 40 | 41 | private static getLinkedConfigs(keys: T[], config: BaseConfig): W[] { 42 | let result: W[] = []; 43 | for (let i = 0; i < keys.length; i++) { 44 | result.push(config.get(keys[i], true)); 45 | } 46 | return result; 47 | } 48 | } -------------------------------------------------------------------------------- /Config/Generator/templates/2/template/ConfigSingle.txt: -------------------------------------------------------------------------------- 1 | {0}export interface {1} { 2 | readonly configName: string; 3 | {2} 4 | } -------------------------------------------------------------------------------- /Config/Generator/templates/2/template/ConfigVar.txt: -------------------------------------------------------------------------------- 1 | private static {0}: BaseConfig<{1}, {2}>; 2 | public static get {3}(): BaseConfig<{4}, {5}> { return this.{6}; } -------------------------------------------------------------------------------- /Config/Generator/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* 项目 */ 4 | // "incremental": true, /* 启用增量编译 */ 5 | // "composite": true, /* 启用允许TypeScript项目与项目引用一起使用的约束 */ 6 | // "tsBuildInfoFile": "./", /* 指定增量编译文件.tsbuildinfo的文件夹 */ 7 | // "disableSourceOfProjectReferenceRedirect": true, /* 在引用组合项目时禁用偏向源文件而不是声明文件 */ 8 | // "disableSolutionSearching": true, /* 编辑时从多项目参考检查中选择一个项目 */ 9 | // "disableReferencedProjectLoad": true, /* 减少TypeScript自动加载的项目数量 */ 10 | 11 | /* 语言、环境 */ 12 | "target": "es2016", /* 设置JavaScript语言版本并包含兼容的库声明 */ 13 | // "lib": [], /* 指定一组绑定的库声明文件,用于描述目标运行时环境 */ 14 | // "jsx": "react", /* Specify what JSX code is generated. */ 15 | "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ 16 | "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ 17 | // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */ 18 | // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ 19 | // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */ 20 | // "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */ 21 | // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ 22 | // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ 23 | 24 | /* 模块 */ 25 | "module": "CommonJS", /* 指定生成的模块代码 */ 26 | "rootDir": "./src/", /* 指定源文件中的根文件夹 */ 27 | "moduleResolution": "node", /* 指定 TypeScript 如何从给定的模块说明符中查找文件 */ 28 | // "baseUrl": "./", /* 指定用于解析非相对模块名称的基目录 */ 29 | // "paths": {}, /* 指定一组条目,它们将导入重新映射到其他查找位置 */ 30 | // "rootDirs": [], /* 在解析模块时,允许将多个文件夹视为一个 */ 31 | // "typeRoots": [], /* 指定多个类似于“./node_modules/@types”的文件夹 */ 32 | // "types": [], /* 指定要包含而不被源文件引用的类型包名称 */ 33 | // "allowUmdGlobalAccess": true, /* 允许从模块访问 UMD 全局变量 */ 34 | // "resolveJsonModule": true, /* 启用导入 .json 文件 */ 35 | // "noResolve": true, /* 禁止使用“import”、“require”或“”来扩展 TypeScript 应该添加到项目中的文件数量*/ 36 | 37 | /* JavaScript 支持 */ 38 | "allowJs": true, /* 允许JavaScript文件成为程序的一部分(使用 checkJS 选项从这些文件中获取错误) */ 39 | // "checkJs": true, /* 在类型检查的JavaScript文件中启用错误报告 */ 40 | "maxNodeModuleJsDepth": 5, /* 指定用于从“node_modules”中检查 JavaScript 文件的最大文件夹深度(只适用于allowJs) */ 41 | 42 | /* 发布 */ 43 | // "declaration": true, /* 从你项目中的 TypeScript 和 JavaScript 文件生成 .d.ts 文件 */ 44 | // "declarationMap": true, /* Create sourcemaps for d.ts files. */ 45 | // "emitDeclarationOnly": true, /* 只输出 d.ts 文件,不输出JavaScript文件 */ 46 | "sourceMap": false, /* 为发布的 JavaScript 文件创建源映射文件。 */ 47 | // "outFile": "./dist/main.js", 48 | "outDir": "./dist/", /* 为所有发布文件指定一个输出文件夹 */ 49 | "removeComments": true, /* 发布时移除代码注释 */ 50 | // "noEmit": true, /* 禁止从编译中发出文件 */ 51 | // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ 52 | // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */ 53 | // "downlevelIteration": true, /* 发布将更加兼容,但会存在冗长且性能较差的 JavaScript 用于迭代 */ 54 | // "sourceRoot": "", /* 指定调试器查找参考源代码的根路径 */ 55 | // "mapRoot": "", /* 指定调试器定位映射文件的位置,而不是生成的位置 */ 56 | // "inlineSourceMap": true, /* 在发布的 JavaScript 中包含 sourcemap 文件. */ 57 | // "inlineSources": true, /* 在发布的 JavaScript 的源地图中包含源代码 */ 58 | // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ 59 | // "newLine": "crlf", /* 设置用于发布文件的换行字符 */ 60 | // "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */ 61 | // "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */ 62 | // "noEmitOnError": true, /* 如果任一类型检查出错将禁用发布文件 */ 63 | // "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */ 64 | // "declarationDir": "./", /* 为生成的声明文件指定输出目录 */ 65 | // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ 66 | 67 | /* 交互约束 */ 68 | // "isolatedModules": true, /* 确保每个文件可以安全转译,而不依赖于其他导入 */ 69 | // "allowSyntheticDefaultImports": true, /* 当模块没有默认导出时允许 import x from y */ 70 | "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */ 71 | // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ 72 | "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ 73 | 74 | /* 类型检查 */ 75 | "strict": true, /* 启用所有严格的类型检查 */ 76 | "noImplicitAny": false, /* 对隐性的 any 类型的表达式和声明启用错误报告。 */ 77 | "strictNullChecks": false, /* 当类型检查时,考虑 null 和 undefined */ 78 | // "strictFunctionTypes": true, /* 在给函数赋值时,要确保参数和返回值是子类型兼容的 */ 79 | // "strictBindCallApply": true, /* 检查 bind、call、apply 方法的参数是否与原始函数匹配 */ 80 | // "strictPropertyInitialization": true, /* 检查在构造函数中声明但没有设置的类属性 */ 81 | "noImplicitThis": true, /* 当 this 被赋予 any 类型时启用错误报告 */ 82 | // "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */ 83 | // "alwaysStrict": true, /* 确保总是发布“use strict” */ 84 | "noUnusedLocals": false, /* 存在未读取的局部变量时启用错误报告 */ 85 | "noUnusedParameters": false, /* 存在未读取的函数参数时启用错误报告 */ 86 | // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ 87 | // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ 88 | // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ 89 | // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ 90 | // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ 91 | // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */ 92 | // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ 93 | // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ 94 | 95 | /* 完整性 */ 96 | // "skipDefaultLibCheck": true, /* 跳过在 TypeScript 中的.d.ts 文件的类型检查 */ 97 | "skipLibCheck": true /* 跳过所有 .d.ts 文件类型检查 */ 98 | }, 99 | "include": [ 100 | "src" 101 | ] 102 | } 103 | -------------------------------------------------------------------------------- /Config/Generator/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultSeverity": "error", 3 | "extends": [ 4 | "tslint:recommended" 5 | ], 6 | "jsRules": {}, 7 | "rules": { 8 | "no-console": false 9 | }, 10 | "rulesDirectory": [] 11 | } -------------------------------------------------------------------------------- /Config/README.MD: -------------------------------------------------------------------------------- 1 | # 游戏配置生成工具 2 | 3 | 在游戏开发中,**游戏配置**是屡见不鲜的东西了。一个好的配置生成工具能让你在开发中事半功倍。 4 | 5 | 通常来说,**配置**都是由**策划**来产出并维护的,绝大多数**策划岗**都不了解开发,他们最喜欢的就是**Excel表格**(**Excel**的确是个好东西)。 6 | 7 | 本工具的主要功能就是把**Excel表格**导出成程序可用的数据。 8 | 9 | --- 10 | 11 | ## 一、安装依赖 12 | 13 | 1. 安装 [Node.js LTS版](https://nodejs.org/en/)(最后测试基于*20.11.0*)。 14 | 2. 打开`命令行`,将目录定位到 `Generator` 目录。 15 | 3. 在命令行中执行命令: npm i,可能会有警告,但没关系,忽略即可。 16 | 17 | --- 18 | 19 | ## 三、使用说明 20 | 21 | 1. 所有配置表的格式为 `*.xls` 或 `*.xlsx`。 22 | 2. 所有配置表都放在本文件夹之下(可嵌套文件夹)。 23 | 其实也可以放在其它地方,通过修改 **Generator/Config.json 的 excel_url** 可以设置配置表路径。 24 | 3. 双击 **gen.bat** 可生成所有配置。 25 | 26 | ### 3.1 Excel 前置表行说明 27 | 28 | **第1行** 29 | 30 | 1. **第一格**为配置表名称。 31 | 2. **第二格**为配置表格式(**横表(Horizontal)、纵表(Vertical)或枚举表(Enum)**),**填英文**。 32 | 3. **第三格**,如果是**枚举表**则为是**生成至..**,如果是**横表**则为**父表名称**。 33 | 34 | **第2行** 35 | 36 | 字段 + 字段类型。 37 | 38 | 格式:用`#`隔开。 39 | 40 | > 例:**name#string**。 41 | 42 | **第3行** 43 | 44 | 字段特殊类型。 45 | 46 | 目前有**数组、表连接、枚举**,下面会详述。 47 | 48 | **第4行** 49 | 50 | 主键。 51 | 52 | 第一主键填1,第二主键填2...,以此类推。 53 | 54 | **第5行** 55 | 56 | 生成至...。 57 | 58 | 根据**Generator/Config.json**的**exports**的**id**去填写。 59 | 60 | 格式:用`|`隔开, 61 | 62 | > 例:**1|2|3**。(**若不填写则全部都生成**) 63 | 64 | **第6行** 65 | 66 | 默认值。 67 | 68 | **第7行** 69 | 70 | 说明备注。 71 | 72 | ### 3.2 字段与类型 73 | 74 | 字段和类型是填写在同一个单元格的,**不能包含中文和空格,首个字符不能是数字**,例如:`sub_type#int`或`subType#int`,生成给程序的都是**小驼峰命名方式**——`subType: number`,如下图: 75 | 76 | ![array](https://github.com/gh-kL/GameConfig/blob/main/Config/Generator/img/field_name.png?raw=true) 77 | 78 | 类型支持: 79 | 80 | | 类型 | 关键字 | 语言支持 | 81 | | :--------------- | :----------- | :------: | 82 | | 布尔 | bool | 全部 | 83 | | 整型 | int | 全部 | 84 | | 浮点型 | float | 全部 | 85 | | 字符串 | string | 全部 | 86 | | 布尔一维数组 | bool[] | 全部 | 87 | | 布尔二维数组 | bool[][] | 全部 | 88 | | 布尔三维数组 | bool[][][] | 全部 | 89 | | 整型一维数组 | int[] | 全部 | 90 | | 整型二维数组 | int[][] | 全部 | 91 | | 整型三维数组 | int[][][] | 全部 | 92 | | 浮点型一维数组 | float[] | 全部 | 93 | | 浮点型二维数组 | float[][] | 全部 | 94 | | 浮点型三维数组 | float[][][] | 全部 | 95 | | 字符串一维数组 | string[] | 全部 | 96 | | 字符串二维数组 | string[][] | 全部 | 97 | | 字符串三维数组 | string[][][] | 全部 | 98 | | 任意类型 | any | JS/TS | 99 | | 任意类型一维数组 | any[] | JS/TS | 100 | 101 | ### 3.3 生成至.. 102 | 103 | 顾名思义,就是生成至哪个端,填写方式由 `|` 隔开,如下图: 104 | 105 | ![array](https://github.com/gh-kL/GameConfig/blob/main/Config/Generator/img/gen_to.png?raw=true) 106 | 107 | 比如现在的 **Config.json** 文件中是这样的: 108 | 109 | | ID | 端 | 110 | | :--- | :--------------------- | 111 | | 1 | Unity 示例项目 | 112 | | 2 | Cocos Creator 示例项目 | 113 | 114 | ### 3.4 特殊类型 115 | 116 | #### 3.4.1 数组 117 | 118 | 在特殊类型的单元格填`array#字段名`即可。如下图: 119 | 120 | ![array](https://github.com/gh-kL/GameConfig/blob/main/Config/Generator/img/array.png?raw=true) 121 | 122 | 导出到程序端是这样子: 123 | 124 | ```json 125 | "attr": [ 126 | [ 10001, 50 ], 127 | [ 10002, 60 ], 128 | [ 10003, 30 ], 129 | [ 10004, 30 ], 130 | [ 10005, 20 ], 131 | ] 132 | ``` 133 | 134 | #### 3.4.2 表连接 135 | 136 | 在特殊类型的单元格填`link#配置表名`即可。如下图: 137 | 138 | ![link](https://github.com/gh-kL/GameConfig/blob/main/Config/Generator/img/link.png?raw=true) 139 | 140 | 上图表示的是 langId 字段连接了语言表(Lang),所以请**确保有另一张叫做 Lang 的表存在**! 141 | 142 | 设置了**表连接**后,程序员就可以很方便的访问到 Lang 配置,伪代码: 143 | 144 | ```js 145 | this.btn.text = config.langId.cn; 146 | ``` 147 | 148 | > 表连接对于策划来说没有任何感知,只是生成出来的配置程序员会用得更舒服。 149 | 150 | #### 3.4.3 枚举 151 | 152 | 在特殊类型的单元格填`enum#枚举表名`即可。如下图: 153 | 154 | ![link](https://github.com/gh-kL/GameConfig/blob/main/Config/Generator/img/enum.png?raw=true) 155 | 156 | 上图表示的是`type`为枚举类型(asset_type)的**枚举**,所以请**确保有另一张叫做 AssetType 的枚举表存在**! 157 | 158 | > 其实填`enum#AssetType`也可以,没差别。 159 | 160 | 枚举表的格式比较特殊,如下图: 161 | 162 | ![link](https://github.com/gh-kL/GameConfig/blob/main/Config/Generator/img/enum_sheet.png?raw=true) 163 | 164 | > 第一列为 **枚举Key**。 165 | > 第二列为 **枚举Value**。**(JS、TS支持整型与字符串;C#端仅支持整型)** 166 | > 第二列为 **备注说明**。 167 | 168 | --- 169 | 170 | ## 四、配置(Config) 171 | 172 | 本工具的配置是`Generator/Config.json`。 173 | 174 | 字段说明: 175 | 176 | ```js 177 | { 178 | excel_url: "配置表URL(Excel的文件夹路径)", 179 | export_suffix: "配置导出脚本后的命名后缀(推荐Config)", 180 | export_item_suffix: "配置子项导出脚本后的命名后缀(推荐Item)", 181 | export_collection_suffix: "多主键配置导出脚本后字典的命名后缀(推荐Map)", 182 | export_data_splitor_random_enabled: "导出的配置脚本是否生成随机分隔符", 183 | export_data_splitor: "固定分隔符", 184 | origin_export_url: "源配置文件夹路径", 185 | origin_json_url: "源配置 JSON 的路径", 186 | origin_remark_url: "源配置 Remark JSON 的路径", 187 | origin_enum_url: "源配置 Enum JSON 的路径", 188 | incrementalPublish: "增量编译", 189 | exports: [ // 所有导出项 190 | id: "导出项 ID", 191 | enabled: "启用(控制是否生成配置)", 192 | code_language: "代码语言", 193 | script_suffix: "脚本文件后缀(扩展名)", 194 | template_name: "模板文件夹名称(若不填则按ID取模板)", 195 | force_make_dir: "强制创建路径", 196 | export_url: "配置文件导出路径", 197 | export_script_url: "配置脚本导出路径", 198 | export_config_manager_name: "配置管理器脚本名称", 199 | ], 200 | } 201 | ``` 202 | 203 | ## 五、自定义导出项(程序向) 204 | 205 | 工程文件夹就是 Generator 文件夹,是 TypeScript 工程,因此你需要一些 TypeScript 基础。 206 | 207 | ### 5.1 项目结构 208 | 209 | | 文件夹 | 描述 | 210 | | :----------- | :----------------------------------------------------- | 211 | | dist | 编译脚本导出路径 | 212 | | img | 图片(主要作用于本 Markdown) | 213 | | node_modules | node 模块目录(第一章的**安装依赖**就是安装到这里) | 214 | | src | 源码 | 215 | | templates | 模板,用于生成代码的模板文本文件 | 216 | | Config.json | 本工具的配置文件 | 217 | | 其它文件 | 其它就不解释了,想要了解请自行百度`TypeScript项目结构` | 218 | 219 | ### 5.2 自定义生成配置脚本 220 | 221 | 目前工具内已内置了生成**TS、C#**配置脚本的源码,分别是`GenTSModule.ts`和`GenCSModule.ts`。 222 | 223 | 比如你想要生成**Lua**配置脚本,那就新建个`GenLuaModule.ts`,逻辑呢就参考上面的两个就好,写起来会比较枯燥。 224 | 225 | > 修改完源码后,记得要在终端执行`npx tsc`,将 TS 代码全都编译成 JS 代码,工具最终运行的都是 JS 代码。 226 | 227 | --- 228 | 229 | Author: kL 230 | 231 | E-mail: *klk0@qq.com* 232 | 233 | --- 234 | -------------------------------------------------------------------------------- /Config/gen.bat: -------------------------------------------------------------------------------- 1 | cd Generator 2 | node dist/main.js 3 | pause -------------------------------------------------------------------------------- /Config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "generator", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "main.js", 6 | "scripts": {}, 7 | "keywords": [], 8 | "author": "", 9 | "license": "ISC", 10 | "dependencies": { 11 | "@types/node": "^18.7.8", 12 | "cli-color": "^2.0.3", 13 | "crypto-js": "^4.1.1", 14 | "node-xlsx": "^0.21.0", 15 | "typescript": "^4.9.5", 16 | "uglify-js": "^3.17.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Config/宠物/C.宠物-Pet.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gh-kL/GameConfig/f1fc10bf55efe3a042f5c249f3335dceeb1ee246/Config/宠物/C.宠物-Pet.xlsx -------------------------------------------------------------------------------- /Config/宠物/C.宠物升阶升级表-PetStepLv.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gh-kL/GameConfig/f1fc10bf55efe3a042f5c249f3335dceeb1ee246/Config/宠物/C.宠物升阶升级表-PetStepLv.xlsx -------------------------------------------------------------------------------- /Config/宠物/C.宠物类型枚举-PetType.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gh-kL/GameConfig/f1fc10bf55efe3a042f5c249f3335dceeb1ee246/Config/宠物/C.宠物类型枚举-PetType.xlsx -------------------------------------------------------------------------------- /Config/属性/S.属性字段转ID-AttrField2ID.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gh-kL/GameConfig/f1fc10bf55efe3a042f5c249f3335dceeb1ee246/Config/属性/S.属性字段转ID-AttrField2ID.xlsx -------------------------------------------------------------------------------- /Config/属性/S.属性表-Attr.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gh-kL/GameConfig/f1fc10bf55efe3a042f5c249f3335dceeb1ee246/Config/属性/S.属性表-Attr.xlsx -------------------------------------------------------------------------------- /Config/物品/W.物品-Goods.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gh-kL/GameConfig/f1fc10bf55efe3a042f5c249f3335dceeb1ee246/Config/物品/W.物品-Goods.xlsx -------------------------------------------------------------------------------- /Config/物品/W.物品类型枚举-GoodsType.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gh-kL/GameConfig/f1fc10bf55efe3a042f5c249f3335dceeb1ee246/Config/物品/W.物品类型枚举-GoodsType.xlsx -------------------------------------------------------------------------------- /Config/物品/Z.装备-Equip.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gh-kL/GameConfig/f1fc10bf55efe3a042f5c249f3335dceeb1ee246/Config/物品/Z.装备-Equip.xlsx -------------------------------------------------------------------------------- /Config/物品/Z.装备位置枚举-EquipPosition.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gh-kL/GameConfig/f1fc10bf55efe3a042f5c249f3335dceeb1ee246/Config/物品/Z.装备位置枚举-EquipPosition.xlsx -------------------------------------------------------------------------------- /Example/CCCProject/README.md: -------------------------------------------------------------------------------- 1 | 理论上用任何Cocos Creator版本打开都可以。 2 | 3 | 本实例主要展示了取出配置的值并输出在屏幕上。 -------------------------------------------------------------------------------- /Example/CCCProject/assets/config.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "f77f38ac-5300-4b16-b0fa-b2444fb86f80", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Example/CCCProject/assets/resources.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "c8df1b98-0c78-43d3-8e5d-066b7bea05e4", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "isBundle": true, 10 | "bundleName": "resources", 11 | "priority": 8, 12 | "bundleConfigID": "auto_75RDn4C5VHIqKUWxkv4196" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Example/CCCProject/assets/resources/config.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "5985323b-9133-4646-b384-d8aa886be94c", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Example/CCCProject/assets/resources/config/config.json: -------------------------------------------------------------------------------- 1 | [1,1,3,"子鼠",[10101,10102],2,2,2,"丑牛",[10201,10202],3,3,1,"寅虎",[10301,10302],"_D3A_","1_1_1",1,1,1,1,1,1,[[3,10]],"1_1_2",1,1,2,1,1,2,[[3,11]],"1_1_3",1,1,3,1,1,3,[[3,12]],"1_1_4",1,1,4,1,1,4,[[3,13]],"1_1_5",1,1,5,1,1,5,[[3,14]],"1_1_6",1,1,6,1,1,6,[[3,15]],"1_1_7",1,1,7,1,1,7,[[3,16]],"1_1_8",1,1,8,1,1,8,[[3,17]],"1_1_9",1,1,9,1,1,9,[[3,18]],"1_1_10",1,1,10,1,1,10,[[3,19]],"1_2_1",1,2,1,1,2,1,[[3,20]],"1_2_2",1,2,2,1,2,2,[[3,21]],"1_2_3",1,2,3,1,2,3,[[3,22]],"1_2_4",1,2,4,1,2,4,[[3,23]],"1_2_5",1,2,5,1,2,5,[[3,24]],"1_2_6",1,2,6,1,2,6,[[3,25]],"1_2_7",1,2,7,1,2,7,[[3,26]],"1_2_8",1,2,8,1,2,8,[[3,27]],"1_2_9",1,2,9,1,2,9,[[3,28]],"1_2_10",1,2,10,1,2,10,[[3,29]],"1_3_1",1,3,1,1,3,1,[[3,30]],"1_3_2",1,3,2,1,3,2,[[3,31]],"1_3_3",1,3,3,1,3,3,[[3,32]],"1_3_4",1,3,4,1,3,4,[[3,33]],"1_3_5",1,3,5,1,3,5,[[3,34]],"1_3_6",1,3,6,1,3,6,[[3,35]],"1_3_7",1,3,7,1,3,7,[[3,36]],"1_3_8",1,3,8,1,3,8,[[3,37]],"1_3_9",1,3,9,1,3,9,[[3,38]],"1_3_10",1,3,10,1,3,10,[[3,39]],"2_1_1",2,1,1,2,1,1,[[3,10]],"2_1_2",2,1,2,2,1,2,[[3,11]],"2_1_3",2,1,3,2,1,3,[[3,12]],"2_1_4",2,1,4,2,1,4,[[3,13]],"2_1_5",2,1,5,2,1,5,[[3,14]],"2_1_6",2,1,6,2,1,6,[[3,15]],"2_1_7",2,1,7,2,1,7,[[3,16]],"2_1_8",2,1,8,2,1,8,[[3,17]],"2_1_9",2,1,9,2,1,9,[[3,18]],"2_1_10",2,1,10,2,1,10,[[3,19]],"2_2_1",2,2,1,2,2,1,[[3,20]],"2_2_2",2,2,2,2,2,2,[[3,21]],"2_2_3",2,2,3,2,2,3,[[3,22]],"2_2_4",2,2,4,2,2,4,[[3,23]],"2_2_5",2,2,5,2,2,5,[[3,24]],"2_2_6",2,2,6,2,2,6,[[3,25]],"2_2_7",2,2,7,2,2,7,[[3,26]],"2_2_8",2,2,8,2,2,8,[[3,27]],"2_2_9",2,2,9,2,2,9,[[3,28]],"2_2_10",2,2,10,2,2,10,[[3,29]],"2_3_1",2,3,1,2,3,1,[[3,30]],"2_3_2",2,3,2,2,3,2,[[3,31]],"2_3_3",2,3,3,2,3,3,[[3,32]],"2_3_4",2,3,4,2,3,4,[[3,33]],"2_3_5",2,3,5,2,3,5,[[3,34]],"2_3_6",2,3,6,2,3,6,[[3,35]],"2_3_7",2,3,7,2,3,7,[[3,36]],"2_3_8",2,3,8,2,3,8,[[3,37]],"2_3_9",2,3,9,2,3,9,[[3,38]],"2_3_10",2,3,10,2,3,10,[[3,39]],"3_1_1",3,1,1,3,1,1,[[3,10]],"3_1_2",3,1,2,3,1,2,[[3,11]],"3_1_3",3,1,3,3,1,3,[[3,12]],"3_1_4",3,1,4,3,1,4,[[3,13]],"3_1_5",3,1,5,3,1,5,[[3,14]],"3_1_6",3,1,6,3,1,6,[[3,15]],"3_1_7",3,1,7,3,1,7,[[3,16]],"3_1_8",3,1,8,3,1,8,[[3,17]],"3_1_9",3,1,9,3,1,9,[[3,18]],"3_1_10",3,1,10,3,1,10,[[3,19]],"3_2_1",3,2,1,3,2,1,[[3,20]],"3_2_2",3,2,2,3,2,2,[[3,21]],"3_2_3",3,2,3,3,2,3,[[3,22]],"3_2_4",3,2,4,3,2,4,[[3,23]],"3_2_5",3,2,5,3,2,5,[[3,24]],"3_2_6",3,2,6,3,2,6,[[3,25]],"3_2_7",3,2,7,3,2,7,[[3,26]],"3_2_8",3,2,8,3,2,8,[[3,27]],"3_2_9",3,2,9,3,2,9,[[3,28]],"3_2_10",3,2,10,3,2,10,[[3,29]],"3_3_1",3,3,1,3,3,1,[[3,30]],"3_3_2",3,3,2,3,3,2,[[3,31]],"3_3_3",3,3,3,3,3,3,[[3,32]],"3_3_4",3,3,4,3,3,4,[[3,33]],"3_3_5",3,3,5,3,3,5,[[3,34]],"3_3_6",3,3,6,3,3,6,[[3,35]],"3_3_7",3,3,7,3,3,7,[[3,36]],"3_3_8",3,3,8,3,3,8,[[3,37]],"3_3_9",3,3,9,3,3,9,[[3,38]],"3_3_10",3,3,10,3,3,10,[[3,39]],"_D3A_","hpMax","hpMax",1,"mpMax","mpMax",2,"atk","atk",3,"def","def",4,"crit","crit",5,"hit","hit",6,"ev","ev",7,"move","move",8,"_D3A_",1,1,"hpMax","气血",2,2,"mpMax","内力",3,3,"atk","攻击",4,4,"def","防御",5,5,"crit","暴击",6,6,"hit","命中",7,7,"ev","闪避",8,8,"move","移动","_D3A_",10001,10001,"干粮",1,1,5,"食物之一。",10002,10002,"粽子",1,1,10,"以竹叶包入米饭和馅料,蒸炊而成。",10003,10003,"澄心堂纸",1,1,300,"后唐李煜时期研发出的纸,坚洁如玉、细薄光润,冠绝一世。但产量极少,弥足珍贵。",10004,10004,"东厂令牌",1,1,0,"持有此令牌者会被视为东厂的人。",10005,10005,"东坡肉",1,1,350,"由苏轼发明。用皮薄肉嫩的上选五花猪肉,加入精酿的绍兴黄酒,以小火焖烧而成。",20001,20001,"逍遥丹",1,2,100,"恢复气血一千点。",20002,20002,"双冲饮",1,2,300,"恢复气血五成,内力五成。",20003,20003,"三顺散",2,2,1000,"恢复气血一千五百点,恢复内力五百点,解负向状态一个。",20004,20004,"九转还魂丹",3,2,2000,"将生命恢复到全满。",31001,31001,"铁刀",1,3,100,"以铁铸成,比青铜刀坚硬,但易生锈。",31002,31002,"太刀",2,3,1500,"由东瀛传入,刀身薄长,挥砍刺皆可,杀气冲天。",31003,31003,"金钱镖",1,3,50,"以金钱做为暗器使用。此暗器因无利刃,故需强大的腕力才能发出。",31004,31004,"碎宇刀",3,3,2500,"传说碎宇刀可斩断一切事物,所过之处,寸草不生。",31005,31005,"傲天神剑",3,3,3000,"传说中的剑中神兵,具有神秘力量。",32001,32001,"锁子甲",1,3,500,"将钢片一片片以铁链所住,可以得到比铁甲更好的防护效果。",32002,32002,"五色甲",2,3,1500,"甲上有五色,相传为女娲补天所用之五色石所制,具有神秘力量。",33001,33001,"玉佩",1,3,300,"配饰,相传玉有些微的祛邪效果。",33002,33002,"神剑令",2,3,1700,"铸剑山庄的令牌,配戴可增强暴击率50%。","_D3A_",31001,31001,1,[[3,100]],31002,31002,1,[[3,350]],31003,31003,1,[[3,70]],31004,31004,1,[[3,560]],31005,31005,1,[[3,700]],32001,32001,2,[[4,200]],32002,32002,2,[[4,350]],33001,33001,3,[[7,15]],33002,33002,3,[[5,5000]],"_D3A_","Hello World","1.0.0",[35,0,0],[[0,25,-23],[],[3,6]],["aaa","bbb","ccc"],328549495,true] -------------------------------------------------------------------------------- /Example/CCCProject/assets/resources/config/config.json.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.0.1", 3 | "importer": "json", 4 | "imported": true, 5 | "uuid": "57540180-4b04-4b6d-8cf1-0bbfa1a6f295", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /Example/CCCProject/assets/scenes.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "c751a831-398f-4bf3-bc43-eaa441d94c99", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Example/CCCProject/assets/scenes/Example.scene.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.50", 3 | "importer": "scene", 4 | "imported": true, 5 | "uuid": "4a5c4668-1a2b-4264-9876-5a97065aa3d5", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "47b42dc3-7aa6-4293-aa2c-208371dd188f", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/Example.ts: -------------------------------------------------------------------------------- 1 | import { _decorator, Component, Node, resources, TextAsset, Label } from 'cc'; 2 | import { ConfigMgr } from './config/ConfigMgr'; 3 | import { EquipConfigItem } from './config/EquipConfigItem'; 4 | const { ccclass, property } = _decorator; 5 | 6 | @ccclass('Example') 7 | export class Example extends Component { 8 | 9 | @property({ type: Label }) 10 | private label = null; 11 | 12 | start() { 13 | ConfigMgr.init("config/config", this, this.onConfigInitComplete); 14 | } 15 | 16 | onConfigInitComplete() { 17 | console.log(ConfigMgr.PetStepLvConfig.get("3_2_3")); 18 | 19 | (this.label as Label).string = `${ConfigMgr.KVConfig.gameName} 20 | ${ConfigMgr.KVConfig.version} 21 | ${ConfigMgr.KVConfig.a} 22 | ${ConfigMgr.KVConfig.b} 23 | ${ConfigMgr.KVConfig.c} 24 | ${ConfigMgr.KVConfig.f} 25 | ${ConfigMgr.PetConfig.get(3).name} 26 | ${ConfigMgr.PetStepLvConfig.get("3_2_3").attr} 27 | ${ConfigMgr.PetStepLvConfigMap.get(3).get(2).get(3).attr} 28 | ${ConfigMgr.AttrConfig.get(3).name} 29 | ${ConfigMgr.AttrConfig.get(3).field} 30 | ${ConfigMgr.AttrField2IDConfig.get(ConfigMgr.AttrConfig.get(3).field).id} 31 | ${ConfigMgr.GoodsConfig.get(20004).name} 32 | ${ConfigMgr.GoodsConfig.get(31005).name} 33 | ${ConfigMgr.GoodsConfig.get(31005).type} 34 | ${(ConfigMgr.GoodsConfig.get(31005) as EquipConfigItem).position} 35 | `; 36 | } 37 | } 38 | 39 | -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/Example.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.23", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "3b4b905c-a72e-40b7-9a35-b996038bdcd6", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "d988ada7-a6ae-4f8b-9af2-ba6305243d35", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": { 9 | "compressionType": {}, 10 | "isRemoteBundle": {} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/AttrConfigItem.ts: -------------------------------------------------------------------------------- 1 | export interface AttrConfigItem { 2 | /** 3 | * 唯一Key 4 | */ 5 | readonly uniqueKey: number; 6 | /** 7 | * 索引(id) 8 | */ 9 | readonly id: number; 10 | /** 11 | * 字段 12 | */ 13 | readonly field: string; 14 | /** 15 | * 名称 16 | */ 17 | readonly name: string; 18 | } -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/AttrConfigItem.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.23", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "1b3248f2-8586-40cb-825e-b7987713d6e7", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/AttrField2IDConfigItem.ts: -------------------------------------------------------------------------------- 1 | export interface AttrField2IDConfigItem { 2 | /** 3 | * 唯一Key 4 | */ 5 | readonly uniqueKey: string; 6 | /** 7 | * 索引(field) 8 | */ 9 | readonly field: string; 10 | /** 11 | * ID 12 | */ 13 | readonly id: number; 14 | } -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/AttrField2IDConfigItem.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.23", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "544ec344-56d4-4484-bc70-6fb1712d9763", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/BaseConfig.ts: -------------------------------------------------------------------------------- 1 | export class BaseConfig { 2 | private _configName: string; 3 | public get configName() { 4 | return this._configName; 5 | } 6 | 7 | private _data: Map; 8 | public get data(): Map { 9 | return this._data; 10 | }; 11 | 12 | constructor(configName: string, sourceData: Map) { 13 | this._configName = configName; 14 | this._data = sourceData; 15 | } 16 | 17 | public get(key: T, ifNullThrowError: boolean = false): W { 18 | if (ifNullThrowError) { 19 | if (!this._data.has(key)) 20 | console.error(`${this._configName} not found => ${key}`); 21 | } 22 | return this._data.get(key); 23 | } 24 | } -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/BaseConfig.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.23", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "b1ba8dff-4423-48cc-8555-9061d7c5d006", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/ConfigMgr.ts: -------------------------------------------------------------------------------- 1 | import { BaseConfig } from "./BaseConfig"; 2 | import { JsonAsset, resources } from "cc"; 3 | import { PetConfigItem } from "./PetConfigItem"; 4 | import { PetStepLvConfigItem } from "./PetStepLvConfigItem"; 5 | import { AttrField2IDConfigItem } from "./AttrField2IDConfigItem"; 6 | import { AttrConfigItem } from "./AttrConfigItem"; 7 | import { GoodsConfigItem } from "./GoodsConfigItem"; 8 | import { EquipConfigItem } from "./EquipConfigItem"; 9 | import { KVConfig } from "./KVConfig"; 10 | 11 | export class ConfigMgr { 12 | private static _petConfig: BaseConfig; 13 | public static get PetConfig(): BaseConfig { return this._petConfig; } 14 | 15 | private static _petStepLvConfig: BaseConfig; 16 | public static get PetStepLvConfig(): BaseConfig { return this._petStepLvConfig; } 17 | 18 | private static _petStepLvConfigMap: Map>>; 19 | public static get PetStepLvConfigMap(): Map>> { return this._petStepLvConfigMap; }; 20 | 21 | private static _attrField2IDConfig: BaseConfig; 22 | public static get AttrField2IDConfig(): BaseConfig { return this._attrField2IDConfig; } 23 | 24 | private static _attrConfig: BaseConfig; 25 | public static get AttrConfig(): BaseConfig { return this._attrConfig; } 26 | 27 | private static _goodsConfig: BaseConfig; 28 | public static get GoodsConfig(): BaseConfig { return this._goodsConfig; } 29 | 30 | private static _equipConfig: BaseConfig; 31 | public static get EquipConfig(): BaseConfig { return this._equipConfig; } 32 | 33 | private static _kVConfig: KVConfig; 34 | public static get KVConfig(): KVConfig { return this._kVConfig; }; 35 | 36 | public static init(path: string, thisObj?: any, completeCallback?: Function) { 37 | let self = this; 38 | resources.load("config/config", JsonAsset, (err, asset) => { 39 | console.log(asset); 40 | self.parse(asset.json as any); 41 | if (thisObj && completeCallback) { 42 | completeCallback.call(thisObj); 43 | } 44 | }); 45 | } 46 | 47 | public static parse(data: any[]) { 48 | let pwd = "_D3A_"; 49 | 50 | let totalLength = data.length; 51 | let totalLengthLow = totalLength - 1; 52 | let sections: any[][] = []; 53 | let section: any[] = []; 54 | for (let n = 0; n < totalLength; n++) { 55 | let value = data[n]; 56 | if (n == totalLengthLow) { 57 | section.push(value); 58 | sections.push(section); 59 | } else if (pwd == value) { 60 | sections.push(section); 61 | section = []; 62 | } else { 63 | section.push(value); 64 | } 65 | } 66 | let nAdd: number; 67 | 68 | // PetConfig 69 | section = sections[0]; 70 | totalLength = section.length; 71 | nAdd = 5; 72 | let map0 = new Map(); 73 | for (let n = 0; n < totalLength; n += nAdd) { 74 | let item: PetConfigItem = { uniqueKey: section[n], id: section[n + 1], type: section[n + 2], name: section[n + 3], skills: section[n + 4] }; 75 | map0.set(item.uniqueKey, item); 76 | } 77 | this._petConfig = new BaseConfig("PetConfig", map0); 78 | 79 | // PetStepLvConfig 80 | section = sections[1]; 81 | totalLength = section.length; 82 | nAdd = 8; 83 | let map1 = new Map(); 84 | for (let n = 0; n < totalLength; n += nAdd) { 85 | let item: PetStepLvConfigItem = { uniqueKey: section[n], mainKey1: section[n + 1], mainKey2: section[n + 2], mainKey3: section[n + 3], id: section[n + 4], step: section[n + 5], lv: section[n + 6], attr: section[n + 7] }; 86 | map1.set(item.uniqueKey, item); 87 | } 88 | this._petStepLvConfig = new BaseConfig("PetStepLvConfig", map1); 89 | 90 | this._petStepLvConfigMap = new Map>>(); 91 | this._petStepLvConfig.data.forEach(item => { 92 | if (!this._petStepLvConfigMap.has(item.mainKey1)) 93 | this._petStepLvConfigMap.set(item.mainKey1, new Map>()); 94 | if (!this._petStepLvConfigMap.get(item.mainKey1).has(item.mainKey2)) 95 | this._petStepLvConfigMap.get(item.mainKey1).set(item.mainKey2, new Map()); 96 | this._petStepLvConfigMap.get(item.mainKey1).get(item.mainKey2).set(item.mainKey3, item); 97 | }); 98 | 99 | // AttrField2IDConfig 100 | section = sections[2]; 101 | totalLength = section.length; 102 | nAdd = 3; 103 | let map2 = new Map(); 104 | for (let n = 0; n < totalLength; n += nAdd) { 105 | let item: AttrField2IDConfigItem = { uniqueKey: section[n], field: section[n + 1], id: section[n + 2] }; 106 | map2.set(item.uniqueKey, item); 107 | } 108 | this._attrField2IDConfig = new BaseConfig("AttrField2IDConfig", map2); 109 | 110 | // AttrConfig 111 | section = sections[3]; 112 | totalLength = section.length; 113 | nAdd = 4; 114 | let map3 = new Map(); 115 | for (let n = 0; n < totalLength; n += nAdd) { 116 | let item: AttrConfigItem = { uniqueKey: section[n], id: section[n + 1], field: section[n + 2], name: section[n + 3] }; 117 | map3.set(item.uniqueKey, item); 118 | } 119 | this._attrConfig = new BaseConfig("AttrConfig", map3); 120 | 121 | // GoodsConfig 122 | section = sections[4]; 123 | totalLength = section.length; 124 | nAdd = 7; 125 | let map4 = new Map(); 126 | for (let n = 0; n < totalLength; n += nAdd) { 127 | let item: GoodsConfigItem = { uniqueKey: section[n], id: section[n + 1], name: section[n + 2], color: section[n + 3], type: section[n + 4], sellPrice: section[n + 5], desc: section[n + 6] }; 128 | map4.set(item.uniqueKey, item); 129 | } 130 | this._goodsConfig = new BaseConfig("GoodsConfig", map4); 131 | 132 | // EquipConfig 133 | section = sections[5]; 134 | totalLength = section.length; 135 | nAdd = 4; 136 | let map5 = this._goodsConfig; 137 | let map5_self = new Map(); 138 | for (let n = 0; n < totalLength; n += nAdd) { 139 | let parentItem1 = this._goodsConfig.get(section[n]) as GoodsConfigItem; 140 | let item: EquipConfigItem = { uniqueKey: parentItem1.uniqueKey, id: parentItem1.id, name: parentItem1.name, color: parentItem1.color, type: parentItem1.type, sellPrice: parentItem1.sellPrice, desc: parentItem1.desc, position: section[n + 2], attr: section[n + 3] }; 141 | map5.data.set(item.uniqueKey, item); 142 | map5_self.set(item.uniqueKey, item); 143 | } 144 | this._equipConfig = new BaseConfig("EquipConfig", map5_self); 145 | 146 | // KVConfig 147 | section = sections[6]; 148 | this._kVConfig = { configName: "KVConfig", gameName: section[0], version: section[1], a: section[2], b: section[3], c: section[4], d: section[5], f: section[6] }; 149 | 150 | } 151 | 152 | private static getLinkedConfigs(keys: T[], config: BaseConfig): W[] { 153 | let result: W[] = []; 154 | for (let i = 0; i < keys.length; i++) { 155 | result.push(config.get(keys[i], true)); 156 | } 157 | return result; 158 | } 159 | } -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/ConfigMgr.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.23", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "f1923853-2955-4e92-9d9e-b967964acca6", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/EquipConfigItem.ts: -------------------------------------------------------------------------------- 1 | import { GoodsConfigItem } from "./GoodsConfigItem"; 2 | import { EquipPosition } from "./EquipPosition"; 3 | 4 | export interface EquipConfigItem extends GoodsConfigItem { 5 | /** 6 | * 位置 7 | */ 8 | readonly position: EquipPosition; 9 | /** 10 | * 属性 11 | */ 12 | readonly attr: number[][]; 13 | } -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/EquipConfigItem.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.23", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "f8224a05-d599-45a5-856b-63f403cb53c5", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/EquipPosition.ts: -------------------------------------------------------------------------------- 1 | export enum EquipPosition { 2 | /** 3 | * 无 4 | */ 5 | None = 0, 6 | /** 7 | * 武器 8 | */ 9 | Weapon = 1, 10 | /** 11 | * 护甲 12 | */ 13 | Armor = 2, 14 | /** 15 | * 饰品 16 | */ 17 | Ornament = 3 18 | } -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/EquipPosition.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.23", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "d2430771-630f-442f-97e0-a218b7cc11a2", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/GoodsConfigItem.ts: -------------------------------------------------------------------------------- 1 | import { GoodsType } from "./GoodsType"; 2 | 3 | export interface GoodsConfigItem { 4 | /** 5 | * 唯一Key 6 | */ 7 | readonly uniqueKey: number; 8 | /** 9 | * ID(索引) 10 | */ 11 | readonly id: number; 12 | /** 13 | * 名称(语言表) 14 | */ 15 | readonly name: string; 16 | /** 17 | * 品质 18 | */ 19 | readonly color: number; 20 | /** 21 | * 物品类型 22 | */ 23 | readonly type: GoodsType; 24 | /** 25 | * 售出价格 26 | */ 27 | readonly sellPrice: number; 28 | /** 29 | * 描述 30 | */ 31 | readonly desc: string; 32 | } -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/GoodsConfigItem.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.23", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "6ce66720-48ca-4b90-a8d5-e6bff77b0f12", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/GoodsType.ts: -------------------------------------------------------------------------------- 1 | export enum GoodsType { 2 | /** 3 | * 无 4 | */ 5 | None = 0, 6 | /** 7 | * 道具 8 | */ 9 | Item = 1, 10 | /** 11 | * 药品 12 | */ 13 | Medicine = 2, 14 | /** 15 | * 装备 16 | */ 17 | Equip = 3 18 | } -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/GoodsType.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.23", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "75c3ba99-42da-485b-81ed-21e3de3222b6", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/KVConfig.ts: -------------------------------------------------------------------------------- 1 | export interface KVConfig { 2 | readonly configName: string; 3 | /** 4 | * 游戏名称 5 | */ 6 | readonly gameName: string; 7 | /** 8 | * 版本号 9 | */ 10 | readonly version: string; 11 | readonly a: number[]; 12 | readonly b: number[][]; 13 | readonly c: string[]; 14 | readonly d: number; 15 | readonly f: boolean; 16 | } -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/KVConfig.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.23", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "d4538e98-4acb-4651-ba0f-bf27701e393d", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/PetConfigItem.ts: -------------------------------------------------------------------------------- 1 | import { PetType } from "./PetType"; 2 | 3 | export interface PetConfigItem { 4 | /** 5 | * 唯一Key 6 | */ 7 | readonly uniqueKey: number; 8 | /** 9 | * ID(索引) 10 | */ 11 | readonly id: number; 12 | /** 13 | * 类型 14 | */ 15 | readonly type: PetType; 16 | /** 17 | * 名称 18 | */ 19 | readonly name: string; 20 | /** 21 | * 技能 22 | */ 23 | readonly skills: number[]; 24 | } -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/PetConfigItem.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.23", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "76375994-8ee0-4303-ae95-90998bf617d4", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/PetStepLvConfigItem.ts: -------------------------------------------------------------------------------- 1 | export interface PetStepLvConfigItem { 2 | /** 3 | * 唯一Key 4 | */ 5 | readonly uniqueKey: string; 6 | /** 7 | * 第1主键 8 | */ 9 | readonly mainKey1: number; 10 | /** 11 | * 第2主键 12 | */ 13 | readonly mainKey2: number; 14 | /** 15 | * 第3主键 16 | */ 17 | readonly mainKey3: number; 18 | /** 19 | * ID(索引) 20 | */ 21 | readonly id: number; 22 | /** 23 | * 阶 24 | */ 25 | readonly step: number; 26 | /** 27 | * 等级 28 | */ 29 | readonly lv: number; 30 | /** 31 | * 属性 32 | */ 33 | readonly attr: number[][]; 34 | } -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/PetStepLvConfigItem.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.23", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "a1e1f362-1b5e-4914-8fc6-701b8b18f7ab", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/PetType.ts: -------------------------------------------------------------------------------- 1 | export enum PetType { 2 | /** 3 | * 无 4 | */ 5 | None = 0, 6 | /** 7 | * 攻击型 8 | */ 9 | Attack = 1, 10 | /** 11 | * 防御型 12 | */ 13 | Defend = 2, 14 | /** 15 | * 辅助型 16 | */ 17 | Assist = 3 18 | } -------------------------------------------------------------------------------- /Example/CCCProject/assets/scripts/config/PetType.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.23", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "a2ecd257-4145-4898-91dd-1d137d1b285c", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /Example/CCCProject/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CCCProject", 3 | "uuid": "045e6ed8-0a57-4405-8090-0e59d9fd41f3", 4 | "version": "3.6.0", 5 | "creator": { 6 | "version": "3.8.2" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Example/CCCProject/profiles/v2/editor/packages.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /Example/CCCProject/profiles/v2/packages/builder.json: -------------------------------------------------------------------------------- 1 | { 2 | "log": { 3 | "level": 4 4 | }, 5 | "__version__": "1.3.7" 6 | } 7 | -------------------------------------------------------------------------------- /Example/CCCProject/profiles/v2/packages/device.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.1" 3 | } 4 | -------------------------------------------------------------------------------- /Example/CCCProject/profiles/v2/packages/engine.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.8" 3 | } 4 | -------------------------------------------------------------------------------- /Example/CCCProject/profiles/v2/packages/program.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.4" 3 | } 4 | -------------------------------------------------------------------------------- /Example/CCCProject/profiles/v2/packages/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.6" 3 | } 4 | -------------------------------------------------------------------------------- /Example/CCCProject/profiles/v2/packages/scene.json: -------------------------------------------------------------------------------- 1 | { 2 | "gizmos-infos": { 3 | "is2D": false, 4 | "is3DIcon": false, 5 | "iconSize": 2, 6 | "gridVisible": true, 7 | "gridColor": [ 8 | 150, 9 | 150, 10 | 150, 11 | 255 12 | ], 13 | "isIconGizmo3D": false, 14 | "iconGizmoSize": 2, 15 | "isGridVisible": true, 16 | "transformToolName": "position", 17 | "pivot": "pivot", 18 | "coordinate": "local", 19 | "toolsVisibility3d": true 20 | }, 21 | "camera": { 22 | "color": [ 23 | 48, 24 | 48, 25 | 48, 26 | 255 27 | ], 28 | "fov": 45, 29 | "far": 10000, 30 | "near": 0.01, 31 | "wheelSpeed": 0.01, 32 | "wanderSpeed": 10, 33 | "enableAcceleration": true, 34 | "size": "__default_design__", 35 | "far2D": 10000, 36 | "near2D": 1, 37 | "wheelSpeed2D": 6, 38 | "iso": 0, 39 | "aperture": 19, 40 | "shutter": 7 41 | }, 42 | "camera-infos": { 43 | "c77ecaa8-c936-46c4-a5b0-98692673ed87": { 44 | "position": { 45 | "x": 3175.6811957605664, 46 | "y": 3175.6811957605655, 47 | "z": 3175.6811957605637 48 | }, 49 | "rotation": { 50 | "x": -0.2935780888715546, 51 | "y": 0.3552621343397345, 52 | "z": 0.11859608131827208, 53 | "w": 0.8795087783159701 54 | }, 55 | "viewCenter": { 56 | "x": 121.40771502594998, 57 | "y": -128.2930454223074, 58 | "z": 11.819490533394855 59 | }, 60 | "contentRect": { 61 | "x": 0, 62 | "y": 0, 63 | "width": 941, 64 | "height": 405 65 | }, 66 | "scale": 1 67 | }, 68 | "4a5c4668-1a2b-4264-9876-5a97065aa3d5": { 69 | "position": { 70 | "x": 50, 71 | "y": 50, 72 | "z": 50 73 | }, 74 | "rotation": { 75 | "x": -0.27984814233312133, 76 | "y": 0.3647051996310009, 77 | "z": 0.11591689595929512, 78 | "w": 0.8804762392171493 79 | }, 80 | "viewCenter": { 81 | "x": 0, 82 | "y": 0, 83 | "z": 0 84 | }, 85 | "contentRect": { 86 | "x": 0, 87 | "y": 0, 88 | "width": 941, 89 | "height": 405 90 | }, 91 | "scale": 1 92 | } 93 | }, 94 | "camera-uuids": [ 95 | "c77ecaa8-c936-46c4-a5b0-98692673ed87", 96 | "4a5c4668-1a2b-4264-9876-5a97065aa3d5" 97 | ], 98 | "__version__": "1.0.0", 99 | "builder": {}, 100 | "snap-configs": { 101 | "position": { 102 | "x": 1, 103 | "y": 1, 104 | "z": 1 105 | }, 106 | "rotation": 1, 107 | "scale": 1, 108 | "isPositionSnapEnabled": false, 109 | "isRotationSnapEnabled": false, 110 | "isScaleSnapEnabled": false 111 | }, 112 | "rect-snap-configs": { 113 | "enableSnapping": true, 114 | "snapThreshold": 4 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /Example/CCCProject/profiles/v2/packages/server.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.0", 3 | "server_port": 7456 4 | } 5 | -------------------------------------------------------------------------------- /Example/CCCProject/settings/v2/packages/builder.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.3.7", 3 | "textureCompressConfig": { 4 | "genMipmaps": false 5 | }, 6 | "bundleConfig": { 7 | "custom": { 8 | "auto_75RDn4C5VHIqKUWxkv4196": { 9 | "displayName": "resources", 10 | "configs": { 11 | "native": { 12 | "preferredOptions": { 13 | "compressionType": "merge_dep", 14 | "isRemote": false 15 | } 16 | }, 17 | "miniGame": { 18 | "configMode": "overwrite", 19 | "overwriteSettings": { 20 | "alipay-mini-game": { 21 | "compressionType": "merge_dep", 22 | "isRemote": false 23 | }, 24 | "taobao-creative-app": { 25 | "compressionType": "merge_dep", 26 | "isRemote": false 27 | }, 28 | "taobao-mini-game": { 29 | "compressionType": "merge_dep", 30 | "isRemote": false 31 | }, 32 | "bytedance-mini-game": { 33 | "compressionType": "merge_dep", 34 | "isRemote": false 35 | }, 36 | "oppo-mini-game": { 37 | "compressionType": "merge_dep", 38 | "isRemote": false 39 | }, 40 | "huawei-quick-game": { 41 | "compressionType": "merge_dep", 42 | "isRemote": false 43 | }, 44 | "vivo-mini-game": { 45 | "compressionType": "merge_dep", 46 | "isRemote": false 47 | }, 48 | "xiaomi-quick-game": { 49 | "compressionType": "merge_dep", 50 | "isRemote": false 51 | }, 52 | "baidu-mini-game": { 53 | "compressionType": "merge_dep", 54 | "isRemote": false 55 | }, 56 | "wechatgame": { 57 | "compressionType": "merge_dep", 58 | "isRemote": false 59 | }, 60 | "link-sure": { 61 | "compressionType": "merge_dep", 62 | "isRemote": false 63 | }, 64 | "qtt": { 65 | "compressionType": "merge_dep", 66 | "isRemote": false 67 | }, 68 | "cocos-play": { 69 | "compressionType": "merge_dep", 70 | "isRemote": false 71 | } 72 | } 73 | }, 74 | "web": { 75 | "preferredOptions": { 76 | "compressionType": "merge_dep", 77 | "isRemote": false 78 | } 79 | } 80 | } 81 | } 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Example/CCCProject/settings/v2/packages/cocos-service.json: -------------------------------------------------------------------------------- 1 | { 2 | "game": { 3 | "name": "未知游戏", 4 | "app_id": "UNKNOW", 5 | "c_id": "0" 6 | }, 7 | "appConfigMaps": [ 8 | { 9 | "app_id": "UNKNOW", 10 | "config_id": "acd0ec" 11 | } 12 | ], 13 | "configs": [ 14 | { 15 | "app_id": "UNKNOW", 16 | "config_id": "acd0ec", 17 | "config_name": "Default", 18 | "config_remarks": "", 19 | "services": [] 20 | } 21 | ], 22 | "__version__": "3.0.5" 23 | } 24 | -------------------------------------------------------------------------------- /Example/CCCProject/settings/v2/packages/device.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.1" 3 | } 4 | -------------------------------------------------------------------------------- /Example/CCCProject/settings/v2/packages/engine.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.8", 3 | "modules": { 4 | "cache": { 5 | "base": { 6 | "_value": true 7 | }, 8 | "graphcis": { 9 | "_value": true 10 | }, 11 | "gfx-webgl": { 12 | "_value": true 13 | }, 14 | "gfx-webgl2": { 15 | "_value": true 16 | }, 17 | "3d": { 18 | "_value": false 19 | }, 20 | "2d": { 21 | "_value": true 22 | }, 23 | "ui": { 24 | "_value": true 25 | }, 26 | "particle": { 27 | "_value": false 28 | }, 29 | "physics": { 30 | "_value": false, 31 | "_option": "physics-ammo" 32 | }, 33 | "physics-ammo": { 34 | "_value": false 35 | }, 36 | "physics-cannon": { 37 | "_value": false 38 | }, 39 | "physics-physx": { 40 | "_value": false 41 | }, 42 | "physics-builtin": { 43 | "_value": false 44 | }, 45 | "physics-2d": { 46 | "_value": true, 47 | "_option": "physics-2d-box2d" 48 | }, 49 | "physics-2d-box2d": { 50 | "_value": false 51 | }, 52 | "physics-2d-builtin": { 53 | "_value": false 54 | }, 55 | "intersection-2d": { 56 | "_value": true 57 | }, 58 | "primitive": { 59 | "_value": false 60 | }, 61 | "profiler": { 62 | "_value": true 63 | }, 64 | "particle-2d": { 65 | "_value": true 66 | }, 67 | "audio": { 68 | "_value": true 69 | }, 70 | "video": { 71 | "_value": true 72 | }, 73 | "webview": { 74 | "_value": true 75 | }, 76 | "tween": { 77 | "_value": true 78 | }, 79 | "terrain": { 80 | "_value": false 81 | }, 82 | "tiled-map": { 83 | "_value": true 84 | }, 85 | "spine": { 86 | "_value": true 87 | }, 88 | "dragon-bones": { 89 | "_value": true 90 | } 91 | }, 92 | "includeModules": [ 93 | "2d", 94 | "animation", 95 | "audio", 96 | "base", 97 | "dragon-bones", 98 | "gfx-webgl", 99 | "gfx-webgl2", 100 | "intersection-2d", 101 | "light-probe", 102 | "marionette", 103 | "particle-2d", 104 | "physics-2d-box2d", 105 | "profiler", 106 | "skeletal-animation", 107 | "spine", 108 | "tiled-map", 109 | "tween", 110 | "ui", 111 | "video", 112 | "websocket", 113 | "webview" 114 | ], 115 | "noDeprecatedFeatures": { 116 | "value": false, 117 | "version": "" 118 | } 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /Example/CCCProject/settings/v2/packages/information.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.1", 3 | "information": { 4 | "customSplash": { 5 | "id": "customSplash", 6 | "label": "customSplash", 7 | "enable": true, 8 | "customSplash": { 9 | "complete": false, 10 | "form": "https://creator-api.cocos.com/api/form/show?sid=d545ba6a13695a3808cccc629d84e748" 11 | } 12 | }, 13 | "removeSplash": { 14 | "id": "removeSplash", 15 | "label": "removeSplash", 16 | "enable": true, 17 | "removeSplash": { 18 | "complete": false, 19 | "form": "https://creator-api.cocos.com/api/form/show?sid=d545ba6a13695a3808cccc629d84e748" 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Example/CCCProject/settings/v2/packages/program.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.4" 3 | } 4 | -------------------------------------------------------------------------------- /Example/CCCProject/settings/v2/packages/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.6", 3 | "general": { 4 | "designResolution": { 5 | "width": 960, 6 | "height": 640 7 | } 8 | }, 9 | "script": { 10 | "preserveSymlinks": true 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Example/CCCProject/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | /* Base configuration. Do not edit this field. */ 3 | "extends": "./temp/tsconfig.cocos.json", 4 | 5 | /* Add your custom configuration here. */ 6 | "compilerOptions": { 7 | "strict": false 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 68181da2d40531a4895c156541b5795a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Resources/Config.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d1908b97aa56f4643965c9dd69144d4d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Resources/Config/Config.txt: -------------------------------------------------------------------------------- 1 | MQ0KMQ0KMw0K5a2Q6bygDQpbMTAxMDEsMTAxMDJdDQoyDQoyDQoyDQrkuJHniZsNClsxMDIwMSwxMDIwMl0NCjMNCjMNCjENCuWvheiZjg0KWzEwMzAxLDEwMzAyXQ0KIzFfMV8xDQoxDQoxDQoxDQoxDQoxDQoxDQpbWzMsMTBdXQ0KMV8xXzINCjENCjENCjINCjENCjENCjINCltbMywxMV1dDQoxXzFfMw0KMQ0KMQ0KMw0KMQ0KMQ0KMw0KW1szLDEyXV0NCjFfMV80DQoxDQoxDQo0DQoxDQoxDQo0DQpbWzMsMTNdXQ0KMV8xXzUNCjENCjENCjUNCjENCjENCjUNCltbMywxNF1dDQoxXzFfNg0KMQ0KMQ0KNg0KMQ0KMQ0KNg0KW1szLDE1XV0NCjFfMV83DQoxDQoxDQo3DQoxDQoxDQo3DQpbWzMsMTZdXQ0KMV8xXzgNCjENCjENCjgNCjENCjENCjgNCltbMywxN11dDQoxXzFfOQ0KMQ0KMQ0KOQ0KMQ0KMQ0KOQ0KW1szLDE4XV0NCjFfMV8xMA0KMQ0KMQ0KMTANCjENCjENCjEwDQpbWzMsMTldXQ0KMV8yXzENCjENCjINCjENCjENCjINCjENCltbMywyMF1dDQoxXzJfMg0KMQ0KMg0KMg0KMQ0KMg0KMg0KW1szLDIxXV0NCjFfMl8zDQoxDQoyDQozDQoxDQoyDQozDQpbWzMsMjJdXQ0KMV8yXzQNCjENCjINCjQNCjENCjINCjQNCltbMywyM11dDQoxXzJfNQ0KMQ0KMg0KNQ0KMQ0KMg0KNQ0KW1szLDI0XV0NCjFfMl82DQoxDQoyDQo2DQoxDQoyDQo2DQpbWzMsMjVdXQ0KMV8yXzcNCjENCjINCjcNCjENCjINCjcNCltbMywyNl1dDQoxXzJfOA0KMQ0KMg0KOA0KMQ0KMg0KOA0KW1szLDI3XV0NCjFfMl85DQoxDQoyDQo5DQoxDQoyDQo5DQpbWzMsMjhdXQ0KMV8yXzEwDQoxDQoyDQoxMA0KMQ0KMg0KMTANCltbMywyOV1dDQoxXzNfMQ0KMQ0KMw0KMQ0KMQ0KMw0KMQ0KW1szLDMwXV0NCjFfM18yDQoxDQozDQoyDQoxDQozDQoyDQpbWzMsMzFdXQ0KMV8zXzMNCjENCjMNCjMNCjENCjMNCjMNCltbMywzMl1dDQoxXzNfNA0KMQ0KMw0KNA0KMQ0KMw0KNA0KW1szLDMzXV0NCjFfM181DQoxDQozDQo1DQoxDQozDQo1DQpbWzMsMzRdXQ0KMV8zXzYNCjENCjMNCjYNCjENCjMNCjYNCltbMywzNV1dDQoxXzNfNw0KMQ0KMw0KNw0KMQ0KMw0KNw0KW1szLDM2XV0NCjFfM184DQoxDQozDQo4DQoxDQozDQo4DQpbWzMsMzddXQ0KMV8zXzkNCjENCjMNCjkNCjENCjMNCjkNCltbMywzOF1dDQoxXzNfMTANCjENCjMNCjEwDQoxDQozDQoxMA0KW1szLDM5XV0NCjJfMV8xDQoyDQoxDQoxDQoyDQoxDQoxDQpbWzMsMTBdXQ0KMl8xXzINCjINCjENCjINCjINCjENCjINCltbMywxMV1dDQoyXzFfMw0KMg0KMQ0KMw0KMg0KMQ0KMw0KW1szLDEyXV0NCjJfMV80DQoyDQoxDQo0DQoyDQoxDQo0DQpbWzMsMTNdXQ0KMl8xXzUNCjINCjENCjUNCjINCjENCjUNCltbMywxNF1dDQoyXzFfNg0KMg0KMQ0KNg0KMg0KMQ0KNg0KW1szLDE1XV0NCjJfMV83DQoyDQoxDQo3DQoyDQoxDQo3DQpbWzMsMTZdXQ0KMl8xXzgNCjINCjENCjgNCjINCjENCjgNCltbMywxN11dDQoyXzFfOQ0KMg0KMQ0KOQ0KMg0KMQ0KOQ0KW1szLDE4XV0NCjJfMV8xMA0KMg0KMQ0KMTANCjINCjENCjEwDQpbWzMsMTldXQ0KMl8yXzENCjINCjINCjENCjINCjINCjENCltbMywyMF1dDQoyXzJfMg0KMg0KMg0KMg0KMg0KMg0KMg0KW1szLDIxXV0NCjJfMl8zDQoyDQoyDQozDQoyDQoyDQozDQpbWzMsMjJdXQ0KMl8yXzQNCjINCjINCjQNCjINCjINCjQNCltbMywyM11dDQoyXzJfNQ0KMg0KMg0KNQ0KMg0KMg0KNQ0KW1szLDI0XV0NCjJfMl82DQoyDQoyDQo2DQoyDQoyDQo2DQpbWzMsMjVdXQ0KMl8yXzcNCjINCjINCjcNCjINCjINCjcNCltbMywyNl1dDQoyXzJfOA0KMg0KMg0KOA0KMg0KMg0KOA0KW1szLDI3XV0NCjJfMl85DQoyDQoyDQo5DQoyDQoyDQo5DQpbWzMsMjhdXQ0KMl8yXzEwDQoyDQoyDQoxMA0KMg0KMg0KMTANCltbMywyOV1dDQoyXzNfMQ0KMg0KMw0KMQ0KMg0KMw0KMQ0KW1szLDMwXV0NCjJfM18yDQoyDQozDQoyDQoyDQozDQoyDQpbWzMsMzFdXQ0KMl8zXzMNCjINCjMNCjMNCjINCjMNCjMNCltbMywzMl1dDQoyXzNfNA0KMg0KMw0KNA0KMg0KMw0KNA0KW1szLDMzXV0NCjJfM181DQoyDQozDQo1DQoyDQozDQo1DQpbWzMsMzRdXQ0KMl8zXzYNCjINCjMNCjYNCjINCjMNCjYNCltbMywzNV1dDQoyXzNfNw0KMg0KMw0KNw0KMg0KMw0KNw0KW1szLDM2XV0NCjJfM184DQoyDQozDQo4DQoyDQozDQo4DQpbWzMsMzddXQ0KMl8zXzkNCjINCjMNCjkNCjINCjMNCjkNCltbMywzOF1dDQoyXzNfMTANCjINCjMNCjEwDQoyDQozDQoxMA0KW1szLDM5XV0NCjNfMV8xDQozDQoxDQoxDQozDQoxDQoxDQpbWzMsMTBdXQ0KM18xXzINCjMNCjENCjINCjMNCjENCjINCltbMywxMV1dDQozXzFfMw0KMw0KMQ0KMw0KMw0KMQ0KMw0KW1szLDEyXV0NCjNfMV80DQozDQoxDQo0DQozDQoxDQo0DQpbWzMsMTNdXQ0KM18xXzUNCjMNCjENCjUNCjMNCjENCjUNCltbMywxNF1dDQozXzFfNg0KMw0KMQ0KNg0KMw0KMQ0KNg0KW1szLDE1XV0NCjNfMV83DQozDQoxDQo3DQozDQoxDQo3DQpbWzMsMTZdXQ0KM18xXzgNCjMNCjENCjgNCjMNCjENCjgNCltbMywxN11dDQozXzFfOQ0KMw0KMQ0KOQ0KMw0KMQ0KOQ0KW1szLDE4XV0NCjNfMV8xMA0KMw0KMQ0KMTANCjMNCjENCjEwDQpbWzMsMTldXQ0KM18yXzENCjMNCjINCjENCjMNCjINCjENCltbMywyMF1dDQozXzJfMg0KMw0KMg0KMg0KMw0KMg0KMg0KW1szLDIxXV0NCjNfMl8zDQozDQoyDQozDQozDQoyDQozDQpbWzMsMjJdXQ0KM18yXzQNCjMNCjINCjQNCjMNCjINCjQNCltbMywyM11dDQozXzJfNQ0KMw0KMg0KNQ0KMw0KMg0KNQ0KW1szLDI0XV0NCjNfMl82DQozDQoyDQo2DQozDQoyDQo2DQpbWzMsMjVdXQ0KM18yXzcNCjMNCjINCjcNCjMNCjINCjcNCltbMywyNl1dDQozXzJfOA0KMw0KMg0KOA0KMw0KMg0KOA0KW1szLDI3XV0NCjNfMl85DQozDQoyDQo5DQozDQoyDQo5DQpbWzMsMjhdXQ0KM18yXzEwDQozDQoyDQoxMA0KMw0KMg0KMTANCltbMywyOV1dDQozXzNfMQ0KMw0KMw0KMQ0KMw0KMw0KMQ0KW1szLDMwXV0NCjNfM18yDQozDQozDQoyDQozDQozDQoyDQpbWzMsMzFdXQ0KM18zXzMNCjMNCjMNCjMNCjMNCjMNCjMNCltbMywzMl1dDQozXzNfNA0KMw0KMw0KNA0KMw0KMw0KNA0KW1szLDMzXV0NCjNfM181DQozDQozDQo1DQozDQozDQo1DQpbWzMsMzRdXQ0KM18zXzYNCjMNCjMNCjYNCjMNCjMNCjYNCltbMywzNV1dDQozXzNfNw0KMw0KMw0KNw0KMw0KMw0KNw0KW1szLDM2XV0NCjNfM184DQozDQozDQo4DQozDQozDQo4DQpbWzMsMzddXQ0KM18zXzkNCjMNCjMNCjkNCjMNCjMNCjkNCltbMywzOF1dDQozXzNfMTANCjMNCjMNCjEwDQozDQozDQoxMA0KW1szLDM5XV0NCiNocE1heA0KaHBNYXgNCjENCm1wTWF4DQptcE1heA0KMg0KYXRrDQphdGsNCjMNCmRlZg0KZGVmDQo0DQpjcml0DQpjcml0DQo1DQpoaXQNCmhpdA0KNg0KZXYNCmV2DQo3DQptb3ZlDQptb3ZlDQo4DQojMQ0KMQ0KaHBNYXgNCuawlOihgA0KMg0KMg0KbXBNYXgNCuWGheWKmw0KMw0KMw0KYXRrDQrmlLvlh7sNCjQNCjQNCmRlZg0K6Ziy5b6hDQo1DQo1DQpjcml0DQrmmrTlh7sNCjYNCjYNCmhpdA0K5ZG95LitDQo3DQo3DQpldg0K6Zeq6YG/DQo4DQo4DQptb3ZlDQrnp7vliqgNCiMxMDAwMQ0KMTAwMDENCuW5sueyrg0KMQ0KMQ0KNQ0K6aOf54mp5LmL5LiA44CCDQoxMDAwMg0KMTAwMDINCueyveWtkA0KMQ0KMQ0KMTANCuS7peerueWPtuWMheWFpeexs+mlreWSjOmmheaWme+8jOiSuOeCiuiAjOaIkOOAgg0KMTAwMDMNCjEwMDAzDQrmvoTlv4PloILnurgNCjENCjENCjMwMA0K5ZCO5ZSQ5p2O54Wc5pe25pyf56CU5Y+R5Ye655qE57q477yM5Z2a5rSB5aaC546J44CB57uG6JaE5YWJ5ram77yM5Yag57ud5LiA5LiW44CC5L2G5Lqn6YeP5p6B5bCR77yM5byl6Laz54+N6LS144CCDQoxMDAwNA0KMTAwMDQNCuS4nOWOguS7pOeJjA0KMQ0KMQ0KMA0K5oyB5pyJ5q2k5Luk54mM6ICF5Lya6KKr6KeG5Li65Lic5Y6C55qE5Lq644CCDQoxMDAwNQ0KMTAwMDUNCuS4nOWdoeiCiQ0KMQ0KMQ0KMzUwDQrnlLHoi4/ovbzlj5HmmI7jgILnlKjnmq7oloTogonlq6nnmoTkuIrpgInkupToirHnjKrogonvvIzliqDlhaXnsr7phb/nmoTnu43lhbTpu4TphZLvvIzku6XlsI/ngavnhJbng6fogIzmiJDjgIINCjIwMDAxDQoyMDAwMQ0K6YCN6YGl5Li5DQoxDQoyDQoxMDANCuaBouWkjeawlOihgOS4gOWNg+eCueOAgg0KMjAwMDINCjIwMDAyDQrlj4zlhrLppa4NCjENCjINCjMwMA0K5oGi5aSN5rCU6KGA5LqU5oiQ77yM5YaF5Yqb5LqU5oiQ44CCDQoyMDAwMw0KMjAwMDMNCuS4iemhuuaVow0KMg0KMg0KMTAwMA0K5oGi5aSN5rCU6KGA5LiA5Y2D5LqU55m+54K577yM5oGi5aSN5YaF5Yqb5LqU55m+54K577yM6Kej6LSf5ZCR54q25oCB5LiA5Liq44CCDQoyMDAwNA0KMjAwMDQNCuS5nei9rOi/mOmtguS4uQ0KMw0KMg0KMjAwMA0K5bCG55Sf5ZG95oGi5aSN5Yiw5YWo5ruh44CCDQozMTAwMQ0KMzEwMDENCumTgeWIgA0KMQ0KMw0KMTAwDQrku6Xpk4Hpk7jmiJDvvIzmr5TpnZLpk5zliIDlnZrnoazvvIzkvYbmmJPnlJ/plIjjgIINCjMxMDAyDQozMTAwMg0K5aSq5YiADQoyDQozDQoxNTAwDQrnlLHkuJzngJvkvKDlhaXvvIzliIDouqvoloTplb/vvIzmjKXnoI3liLrnmoblj6/vvIzmnYDmsJTlhrLlpKnjgIINCjMxMDAzDQozMTAwMw0K6YeR6ZKx6ZWWDQoxDQozDQo1MA0K5Lul6YeR6ZKx5YGa5Li65pqX5Zmo5L2/55So44CC5q2k5pqX5Zmo5Zug5peg5Yip5YiD77yM5pWF6ZyA5by65aSn55qE6IWV5Yqb5omN6IO95Y+R5Ye644CCDQozMTAwNA0KMzEwMDQNCueijuWuh+WIgA0KMw0KMw0KMjUwMA0K5Lyg6K+056KO5a6H5YiA5Y+v5pap5pat5LiA5YiH5LqL54mp77yM5omA6L+H5LmL5aSE77yM5a+46I2J5LiN55Sf44CCDQozMTAwNQ0KMzEwMDUNCuWCsuWkqeelnuWJkQ0KMw0KMw0KMzAwMA0K5Lyg6K+05Lit55qE5YmR5Lit56We5YW177yM5YW35pyJ56We56eY5Yqb6YeP44CCDQozMjAwMQ0KMzIwMDENCumUgeWtkOeUsg0KMQ0KMw0KNTAwDQrlsIbpkqLniYfkuIDniYfniYfku6Xpk4Hpk77miYDkvY/vvIzlj6/ku6XlvpfliLDmr5Tpk4HnlLLmm7Tlpb3nmoTpmLLmiqTmlYjmnpzjgIINCjMyMDAyDQozMjAwMg0K5LqU6Imy55SyDQoyDQozDQoxNTAwDQrnlLLkuIrmnInkupToibLvvIznm7jkvKDkuLrlpbPlqLLooaXlpKnmiYDnlKjkuYvkupToibLnn7PmiYDliLbvvIzlhbfmnInnpZ7np5jlipvph4/jgIINCjMzMDAxDQozMzAwMQ0K546J5L2pDQoxDQozDQozMDANCumFjemlsO+8jOebuOS8oOeOieacieS6m+W+rueahOelm+mCquaViOaenOOAgg0KMzMwMDINCjMzMDAyDQrnpZ7liZHku6QNCjINCjMNCjE3MDANCumTuOWJkeWxseW6hOeahOS7pOeJjO+8jOmFjeaItOWPr+WinuW8uuaatOWHu+eOhzUwJeOAgg0KIzMxMDAxDQozMTAwMQ0KMQ0KW1szLDEwMF1dDQozMTAwMg0KMzEwMDINCjENCltbMywzNTBdXQ0KMzEwMDMNCjMxMDAzDQoxDQpbWzMsNzBdXQ0KMzEwMDQNCjMxMDA0DQoxDQpbWzMsNTYwXV0NCjMxMDA1DQozMTAwNQ0KMQ0KW1szLDcwMF1dDQozMjAwMQ0KMzIwMDENCjINCltbNCwyMDBdXQ0KMzIwMDINCjMyMDAyDQoyDQpbWzQsMzUwXV0NCjMzMDAxDQozMzAwMQ0KMw0KW1s3LDE1XV0NCjMzMDAyDQozMzAwMg0KMw0KW1s1LDUwMDBdXQ0KI0hlbGxvIFdvcmxkDQoxLjAuMA0KWzM1LDAsMF0NCltbMCwyNSwtMjNdLFtdLFszLDZdXQ0KWyJhYWEiLCJiYmIiLCJjY2MiXQ0KMzI4NTQ5NDk1DQp0cnVlDQo= -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Resources/Config/Config.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8f0a867f104ba94f849f2ce9e7055d4 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 131a6b21c8605f84396be9f6751fb6e3 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scenes/Example.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2cda990e2423bbf4892e6590ba056729 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f10ec8c3b3eeffc4fab386aa16f1e896 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8cdc8f92332db7a4483a537a1d886d1c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/AttrConfigItem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace GameConfig 4 | { 5 | public class AttrConfigItem 6 | { 7 | /// 8 | /// 唯一主键 9 | /// 10 | public int UniqueKey { private set; get; } 11 | /// 12 | /// 索引(id) 13 | /// 14 | public int Id { private set; get; } 15 | /// 16 | /// 字段 17 | /// 18 | public string Field { private set; get; } 19 | /// 20 | /// 名称 21 | /// 22 | public string Name { private set; get; } 23 | 24 | public AttrConfigItem(int uniqueKey, int id, string field, string name) 25 | { 26 | UniqueKey = uniqueKey; 27 | Id = id; 28 | Field = field; 29 | Name = name; 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/AttrConfigItem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85812dcb770dbeb40b79feabb22e01ee 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/AttrField2IDConfigItem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace GameConfig 4 | { 5 | public class AttrField2IDConfigItem 6 | { 7 | /// 8 | /// 唯一主键 9 | /// 10 | public string UniqueKey { private set; get; } 11 | /// 12 | /// 索引(field) 13 | /// 14 | public string Field { private set; get; } 15 | /// 16 | /// ID 17 | /// 18 | public int Id { private set; get; } 19 | 20 | public AttrField2IDConfigItem(string uniqueKey, string field, int id) 21 | { 22 | UniqueKey = uniqueKey; 23 | Field = field; 24 | Id = id; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/AttrField2IDConfigItem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d418f1a94c1576f4483f2ea49c135a97 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/BaseConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace GameConfig 5 | { 6 | public class BaseConfig 7 | { 8 | public string ConfigName { get; private set; } 9 | 10 | public IReadOnlyDictionary Data { private set; get; } 11 | 12 | public BaseConfig(string configName, IReadOnlyDictionary data) 13 | { 14 | ConfigName = configName; 15 | Data = data; 16 | } 17 | 18 | public W Get(T key) 19 | { 20 | Data.TryGetValue(key, out var result); 21 | return result; 22 | } 23 | 24 | public W Get(T key, bool ifNullThrowException) 25 | { 26 | if (ifNullThrowException) 27 | { 28 | if (!Data.ContainsKey(key)) 29 | throw new Exception($"{ConfigName} not found => {key}"); 30 | } 31 | 32 | Data.TryGetValue(key, out var result); 33 | return result; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/BaseConfig.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1345bac2ed9741f41b904cbc54e0036e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/ConfigMgr.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Text.RegularExpressions; 3 | using UnityEngine; 4 | 5 | namespace GameConfig 6 | { 7 | public static class ConfigMgr 8 | { 9 | public static BaseConfig PetConfig { private set; get; } 10 | public static BaseConfig PetStepLvConfig { private set; get; } 11 | public static Dictionary>> PetStepLvConfigMap { private set; get; } 12 | 13 | public static BaseConfig AttrField2IDConfig { private set; get; } 14 | public static BaseConfig AttrConfig { private set; get; } 15 | public static BaseConfig GoodsConfig { private set; get; } 16 | public static BaseConfig EquipConfig { private set; get; } 17 | public static KVConfig KVConfig { private set; get; } 18 | 19 | public static void Init(string configPath) 20 | { 21 | var textAsset = Resources.Load(configPath) as TextAsset; 22 | var configText = ConfigUtility.DecodeBase64(textAsset.text); 23 | Parse(configText); 24 | } 25 | 26 | public static void Parse(string configText) 27 | { 28 | var sections = configText.Split("#"[0]); 29 | 30 | string section; 31 | string[] lines; 32 | 33 | // PetConfig 34 | section = sections[0]; 35 | lines = Regex.Split(section, "\r\n"); 36 | Dictionary petConfigData = new Dictionary(); 37 | for (int n = 0; n < lines.Length - 1; n += 5) 38 | { 39 | var item = new PetConfigItem(ConfigUtility.ParseInt(lines[n]), ConfigUtility.ParseInt(lines[n + 1]), (PetType) ConfigUtility.ParseInt(lines[n + 2]), lines[n + 3], ConfigUtility.ParseIntList(lines[n + 4])); 40 | petConfigData[item.UniqueKey] = item; 41 | } 42 | PetConfig = new BaseConfig("PetConfig", petConfigData); 43 | 44 | // PetStepLvConfig 45 | section = sections[1]; 46 | lines = Regex.Split(section, "\r\n"); 47 | Dictionary petStepLvConfigData = new Dictionary(); 48 | for (int n = 0; n < lines.Length - 1; n += 8) 49 | { 50 | var item = new PetStepLvConfigItem(lines[n], ConfigUtility.ParseInt(lines[n + 1]), ConfigUtility.ParseInt(lines[n + 2]), ConfigUtility.ParseInt(lines[n + 3]), ConfigUtility.ParseInt(lines[n + 4]), ConfigUtility.ParseInt(lines[n + 5]), ConfigUtility.ParseInt(lines[n + 6]), ConfigUtility.ParseIntList2(lines[n + 7])); 51 | petStepLvConfigData[item.UniqueKey] = item; 52 | } 53 | PetStepLvConfig = new BaseConfig("PetStepLvConfig", petStepLvConfigData); 54 | PetStepLvConfigMap = new Dictionary>>(); 55 | foreach (var keyValuePair in PetStepLvConfig.Data) 56 | { 57 | var item = keyValuePair.Value; 58 | if (!PetStepLvConfigMap.ContainsKey(item.MainKey1)) 59 | PetStepLvConfigMap[item.MainKey1] = new Dictionary>(); 60 | if (!PetStepLvConfigMap[item.MainKey1].ContainsKey(item.MainKey2)) 61 | PetStepLvConfigMap[item.MainKey1][item.MainKey2] = new Dictionary(); 62 | PetStepLvConfigMap[item.MainKey1][item.MainKey2][item.MainKey3] = item; 63 | } 64 | 65 | 66 | // AttrField2IDConfig 67 | section = sections[2]; 68 | lines = Regex.Split(section, "\r\n"); 69 | Dictionary attrField2IDConfigData = new Dictionary(); 70 | for (int n = 0; n < lines.Length - 1; n += 3) 71 | { 72 | var item = new AttrField2IDConfigItem(lines[n], lines[n + 1], ConfigUtility.ParseInt(lines[n + 2])); 73 | attrField2IDConfigData[item.UniqueKey] = item; 74 | } 75 | AttrField2IDConfig = new BaseConfig("AttrField2IDConfig", attrField2IDConfigData); 76 | 77 | // AttrConfig 78 | section = sections[3]; 79 | lines = Regex.Split(section, "\r\n"); 80 | Dictionary attrConfigData = new Dictionary(); 81 | for (int n = 0; n < lines.Length - 1; n += 4) 82 | { 83 | var item = new AttrConfigItem(ConfigUtility.ParseInt(lines[n]), ConfigUtility.ParseInt(lines[n + 1]), lines[n + 2], lines[n + 3]); 84 | attrConfigData[item.UniqueKey] = item; 85 | } 86 | AttrConfig = new BaseConfig("AttrConfig", attrConfigData); 87 | 88 | // GoodsConfig 89 | section = sections[4]; 90 | lines = Regex.Split(section, "\r\n"); 91 | Dictionary goodsConfigData = new Dictionary(); 92 | for (int n = 0; n < lines.Length - 1; n += 7) 93 | { 94 | var item = new GoodsConfigItem(ConfigUtility.ParseInt(lines[n]), ConfigUtility.ParseInt(lines[n + 1]), lines[n + 2], ConfigUtility.ParseInt(lines[n + 3]), (GoodsType) ConfigUtility.ParseInt(lines[n + 4]), ConfigUtility.ParseInt(lines[n + 5]), lines[n + 6]); 95 | goodsConfigData[item.UniqueKey] = item; 96 | } 97 | GoodsConfig = new BaseConfig("GoodsConfig", goodsConfigData); 98 | 99 | // EquipConfig 100 | section = sections[5]; 101 | lines = Regex.Split(section, "\r\n"); 102 | var dict5 = goodsConfigData; 103 | Dictionary dict5_self = new Dictionary(); 104 | for (int n = 0; n < lines.Length - 1; n += 4) 105 | { 106 | var parentItem1 = dict5[ConfigUtility.ParseInt(lines[n])] as GoodsConfigItem; 107 | var item = new EquipConfigItem(ConfigUtility.ParseInt(lines[n]), parentItem1.Id, parentItem1.Name, parentItem1.Color, parentItem1.Type, parentItem1.SellPrice, parentItem1.Desc, (EquipPosition) ConfigUtility.ParseInt(lines[n + 2]), ConfigUtility.ParseIntList2(lines[n + 3])); 108 | dict5[item.UniqueKey] = item; 109 | dict5_self[item.UniqueKey] = item; 110 | } 111 | EquipConfig = new BaseConfig("EquipConfig", dict5_self); 112 | 113 | // KVConfig 114 | section = sections[6]; 115 | lines = Regex.Split(section, "\r\n"); 116 | KVConfig = new KVConfig("KVConfig", lines[0], lines[1], ConfigUtility.ParseIntList(lines[2]), ConfigUtility.ParseIntList2(lines[3]), ConfigUtility.ParseStringList(lines[4]), ConfigUtility.ParseInt(lines[5]), ConfigUtility.ParseBool(lines[6])); 117 | } 118 | } 119 | } -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/ConfigMgr.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e15c266c77f003b46b40fd9266be73ef 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/ConfigUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d18f7017c6103340a7fd2805e65752e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/EquipConfigItem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace GameConfig 4 | { 5 | public class EquipConfigItem : GoodsConfigItem 6 | { 7 | /// 8 | /// 位置 9 | /// 10 | public EquipPosition Position { private set; get; } 11 | /// 12 | /// 属性 13 | /// 14 | public IReadOnlyList> Attr { private set; get; } 15 | 16 | public EquipConfigItem(int uniqueKey, int id, string name, int color, GoodsType type, int sellPrice, string desc, EquipPosition position, IReadOnlyList> attr) : base(uniqueKey, id, name, color, type, sellPrice, desc) 17 | { 18 | Position = position; 19 | Attr = attr; 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/EquipConfigItem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d6f2b5123e9df149abd4545d59f3686 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/EquipPosition.cs: -------------------------------------------------------------------------------- 1 | namespace GameConfig 2 | { 3 | public enum EquipPosition 4 | { 5 | /// 6 | /// 无 7 | /// 8 | None = 0, 9 | /// 10 | /// 武器 11 | /// 12 | Weapon = 1, 13 | /// 14 | /// 护甲 15 | /// 16 | Armor = 2, 17 | /// 18 | /// 饰品 19 | /// 20 | Ornament = 3 21 | } 22 | } -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/EquipPosition.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7b00100f30961d24ab062dacf509f808 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/GoodsConfigItem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace GameConfig 4 | { 5 | public class GoodsConfigItem 6 | { 7 | /// 8 | /// 唯一主键 9 | /// 10 | public int UniqueKey { private set; get; } 11 | /// 12 | /// ID(索引) 13 | /// 14 | public int Id { private set; get; } 15 | /// 16 | /// 名称(语言表) 17 | /// 18 | public string Name { private set; get; } 19 | /// 20 | /// 品质 21 | /// 22 | public int Color { private set; get; } 23 | /// 24 | /// 物品类型 25 | /// 26 | public GoodsType Type { private set; get; } 27 | /// 28 | /// 售出价格 29 | /// 30 | public int SellPrice { private set; get; } 31 | /// 32 | /// 描述 33 | /// 34 | public string Desc { private set; get; } 35 | 36 | public GoodsConfigItem(int uniqueKey, int id, string name, int color, GoodsType type, int sellPrice, string desc) 37 | { 38 | UniqueKey = uniqueKey; 39 | Id = id; 40 | Name = name; 41 | Color = color; 42 | Type = type; 43 | SellPrice = sellPrice; 44 | Desc = desc; 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/GoodsConfigItem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3cc8d4383809f19428212c5dd263e798 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/GoodsType.cs: -------------------------------------------------------------------------------- 1 | namespace GameConfig 2 | { 3 | public enum GoodsType 4 | { 5 | /// 6 | /// 无 7 | /// 8 | None = 0, 9 | /// 10 | /// 道具 11 | /// 12 | Item = 1, 13 | /// 14 | /// 药品 15 | /// 16 | Medicine = 2, 17 | /// 18 | /// 装备 19 | /// 20 | Equip = 3 21 | } 22 | } -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/GoodsType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b9146393aede4e5439d349a5f7dbcd19 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/KVConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace GameConfig 4 | { 5 | public class KVConfig 6 | { 7 | public string ConfigName { get; private set; } 8 | /// 9 | /// 游戏名称 10 | /// 11 | public string GameName { private set; get; } 12 | /// 13 | /// 版本号 14 | /// 15 | public string Version { private set; get; } 16 | public IReadOnlyList A { private set; get; } 17 | public IReadOnlyList> B { private set; get; } 18 | public IReadOnlyList C { private set; get; } 19 | public int D { private set; get; } 20 | public bool F { private set; get; } 21 | 22 | public KVConfig(string configName, string gameName, string version, IReadOnlyList a, IReadOnlyList> b, IReadOnlyList c, int d, bool f) 23 | { 24 | ConfigName = configName; 25 | GameName = gameName; 26 | Version = version; 27 | A = a; 28 | B = b; 29 | C = c; 30 | D = d; 31 | F = f; 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/KVConfig.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 772086c9d352c42449dbab61233df9a2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/PetConfigItem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace GameConfig 4 | { 5 | public class PetConfigItem 6 | { 7 | /// 8 | /// 唯一主键 9 | /// 10 | public int UniqueKey { private set; get; } 11 | /// 12 | /// ID(索引) 13 | /// 14 | public int Id { private set; get; } 15 | /// 16 | /// 类型 17 | /// 18 | public PetType Type { private set; get; } 19 | /// 20 | /// 名称 21 | /// 22 | public string Name { private set; get; } 23 | /// 24 | /// 技能 25 | /// 26 | public IReadOnlyList Skills { private set; get; } 27 | 28 | public PetConfigItem(int uniqueKey, int id, PetType type, string name, IReadOnlyList skills) 29 | { 30 | UniqueKey = uniqueKey; 31 | Id = id; 32 | Type = type; 33 | Name = name; 34 | Skills = skills; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/PetConfigItem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 94b760fb0fc601340ac11ecffa95c2bf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/PetStepLvConfigItem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace GameConfig 4 | { 5 | public class PetStepLvConfigItem 6 | { 7 | /// 8 | /// 唯一主键 9 | /// 10 | public string UniqueKey { private set; get; } 11 | /// 12 | /// 第1主键 13 | /// 14 | public int MainKey1 { private set; get; } 15 | /// 16 | /// 第2主键 17 | /// 18 | public int MainKey2 { private set; get; } 19 | /// 20 | /// 第3主键 21 | /// 22 | public int MainKey3 { private set; get; } 23 | /// 24 | /// ID(索引) 25 | /// 26 | public int Id { private set; get; } 27 | /// 28 | /// 阶 29 | /// 30 | public int Step { private set; get; } 31 | /// 32 | /// 等级 33 | /// 34 | public int Lv { private set; get; } 35 | /// 36 | /// 属性 37 | /// 38 | public IReadOnlyList> Attr { private set; get; } 39 | 40 | public PetStepLvConfigItem(string uniqueKey, int mainKey1, int mainKey2, int mainKey3, int id, int step, int lv, IReadOnlyList> attr) 41 | { 42 | UniqueKey = uniqueKey; 43 | MainKey1 = mainKey1; 44 | MainKey2 = mainKey2; 45 | MainKey3 = mainKey3; 46 | Id = id; 47 | Step = step; 48 | Lv = lv; 49 | Attr = attr; 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/PetStepLvConfigItem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6bfdde4b232916f47b0b8d3c0f9e425c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/PetType.cs: -------------------------------------------------------------------------------- 1 | namespace GameConfig 2 | { 3 | public enum PetType 4 | { 5 | /// 6 | /// 无 7 | /// 8 | None = 0, 9 | /// 10 | /// 攻击型 11 | /// 12 | Attack = 1, 13 | /// 14 | /// 防御型 15 | /// 16 | Defend = 2, 17 | /// 18 | /// 辅助型 19 | /// 20 | Assist = 3 21 | } 22 | } -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Config/PetType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c82249cb6059d084cb9f0e58b30e3e5d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Example.cs: -------------------------------------------------------------------------------- 1 | using GameConfig; 2 | using UnityEngine; 3 | using UnityEngine.UI; 4 | 5 | public class Example : MonoBehaviour 6 | { 7 | public Text text; 8 | 9 | private void Awake() 10 | { 11 | ConfigMgr.Init("Config/Config"); 12 | 13 | text.text = @$"{ConfigMgr.KVConfig.GameName} 14 | {ConfigMgr.KVConfig.Version} 15 | {ConfigMgr.KVConfig.A} 16 | {ConfigMgr.KVConfig.B} 17 | {ConfigMgr.KVConfig.C} 18 | {ConfigMgr.KVConfig.F} 19 | {ConfigMgr.PetConfig.Get(3).Name} 20 | {ConfigMgr.PetStepLvConfig.Get("3_2_3").Attr[0][1]} 21 | {ConfigMgr.PetStepLvConfigMap[3][2][3].Attr[0][1]} 22 | {ConfigMgr.AttrConfig.Get(3).Name} 23 | {ConfigMgr.AttrConfig.Get(3).Field} 24 | {ConfigMgr.AttrField2IDConfig.Get(ConfigMgr.AttrConfig.Get(3).Field).Id} 25 | {ConfigMgr.GoodsConfig.Get(20004).Name} 26 | {ConfigMgr.GoodsConfig.Get(31005).Name} 27 | {ConfigMgr.GoodsConfig.Get(31005).Type} 28 | {(ConfigMgr.GoodsConfig.Get(31005) as EquipConfigItem).Position} 29 | "; 30 | } 31 | } -------------------------------------------------------------------------------- /Example/UnityProject/Assets/Scripts/Example.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 31ebc015a2580454e8a954f6f9dac138 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Example/UnityProject/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.collab-proxy": "2.2.0", 4 | "com.unity.feature.2d": "2.0.0", 5 | "com.unity.ide.rider": "3.0.25", 6 | "com.unity.ide.visualstudio": "2.0.21", 7 | "com.unity.ide.vscode": "1.2.5", 8 | "com.unity.test-framework": "1.1.33", 9 | "com.unity.textmeshpro": "3.0.6", 10 | "com.unity.timeline": "1.6.5", 11 | "com.unity.ugui": "1.0.0", 12 | "com.unity.visualscripting": "1.9.1", 13 | "com.unity.modules.ai": "1.0.0", 14 | "com.unity.modules.androidjni": "1.0.0", 15 | "com.unity.modules.animation": "1.0.0", 16 | "com.unity.modules.assetbundle": "1.0.0", 17 | "com.unity.modules.audio": "1.0.0", 18 | "com.unity.modules.cloth": "1.0.0", 19 | "com.unity.modules.director": "1.0.0", 20 | "com.unity.modules.imageconversion": "1.0.0", 21 | "com.unity.modules.imgui": "1.0.0", 22 | "com.unity.modules.jsonserialize": "1.0.0", 23 | "com.unity.modules.particlesystem": "1.0.0", 24 | "com.unity.modules.physics": "1.0.0", 25 | "com.unity.modules.physics2d": "1.0.0", 26 | "com.unity.modules.screencapture": "1.0.0", 27 | "com.unity.modules.terrain": "1.0.0", 28 | "com.unity.modules.terrainphysics": "1.0.0", 29 | "com.unity.modules.tilemap": "1.0.0", 30 | "com.unity.modules.ui": "1.0.0", 31 | "com.unity.modules.uielements": "1.0.0", 32 | "com.unity.modules.umbra": "1.0.0", 33 | "com.unity.modules.unityanalytics": "1.0.0", 34 | "com.unity.modules.unitywebrequest": "1.0.0", 35 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 36 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 37 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 38 | "com.unity.modules.unitywebrequestwww": "1.0.0", 39 | "com.unity.modules.vehicles": "1.0.0", 40 | "com.unity.modules.video": "1.0.0", 41 | "com.unity.modules.vr": "1.0.0", 42 | "com.unity.modules.wind": "1.0.0", 43 | "com.unity.modules.xr": "1.0.0" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 0 20 | -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/AutoStreamingSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1200 &1 4 | AutoStreamingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | mSearchMode: 15 8 | mCustomSearchFile: 9 | mTextureSearchString: 10 | mMeshSearchString: 11 | mTextures: [] 12 | mAudios: [] 13 | mMeshes: [] 14 | mScenes: [] 15 | mConfigCCD: 16 | useCCD: 0 17 | cosKey: 18 | projectGuid: 19 | bucketUuid: 20 | bucketName: 21 | badgeName: 22 | -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_DefaultMaxDepenetrationVelocity: 10 11 | m_SleepThreshold: 0.005 12 | m_DefaultContactOffset: 0.01 13 | m_DefaultSolverIterations: 6 14 | m_DefaultSolverVelocityIterations: 1 15 | m_QueriesHitBackfaces: 0 16 | m_QueriesHitTriggers: 1 17 | m_EnableAdaptiveForce: 0 18 | m_ClothInterCollisionDistance: 0.1 19 | m_ClothInterCollisionStiffness: 0.2 20 | m_ContactsGeneration: 1 21 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 22 | m_AutoSimulation: 1 23 | m_AutoSyncTransforms: 0 24 | m_ReuseCollisionCallbacks: 1 25 | m_ClothInterCollisionSettingsToggle: 0 26 | m_ClothGravity: {x: 0, y: -9.81, z: 0} 27 | m_ContactPairsMode: 0 28 | m_BroadphaseType: 0 29 | m_WorldBounds: 30 | m_Center: {x: 0, y: 0, z: 0} 31 | m_Extent: {x: 250, y: 250, z: 250} 32 | m_WorldSubdivisions: 8 33 | m_FrictionType: 0 34 | m_EnableEnhancedDeterminism: 0 35 | m_EnableUnifiedHeightmaps: 1 36 | m_SolverType: 0 37 | m_DefaultMaxAngularSpeed: 50 38 | -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Scenes/Example.unity 10 | guid: 2cda990e2423bbf4892e6590ba056729 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_SerializationMode: 2 8 | m_LineEndingsForNewScripts: 0 9 | m_DefaultBehaviorMode: 1 10 | m_PrefabRegularEnvironment: {fileID: 0} 11 | m_PrefabUIEnvironment: {fileID: 0} 12 | m_SpritePackerMode: 4 13 | m_SpritePackerPaddingPower: 1 14 | m_EtcTextureCompressorBehavior: 1 15 | m_EtcTextureFastCompressor: 1 16 | m_EtcTextureNormalCompressor: 2 17 | m_EtcTextureBestCompressor: 4 18 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;asmref;rsp 19 | m_ProjectGenerationRootNamespace: 20 | m_EnableTextureStreamingInEditMode: 1 21 | m_EnableTextureStreamingInPlayMode: 1 22 | m_AsyncShaderCompilation: 1 23 | m_CachingShaderPreprocessor: 1 24 | m_PrefabModeAllowAutoSave: 1 25 | m_EnterPlayModeOptionsEnabled: 0 26 | m_EnterPlayModeOptions: 3 27 | m_GameObjectNamingDigits: 1 28 | m_GameObjectNamingScheme: 0 29 | m_AssetNamingUsesSpace: 1 30 | m_UseLegacyProbeSampleCount: 0 31 | m_SerializeInlineMappingsOnOneLine: 1 32 | m_DisableCookiesInLightmapper: 1 33 | m_AssetPipelineMode: 1 34 | m_CacheServerMode: 0 35 | m_CacheServerEndpoint: 36 | m_CacheServerNamespacePrefix: default 37 | m_CacheServerEnableDownload: 1 38 | m_CacheServerEnableUpload: 1 39 | m_CacheServerEnableAuth: 0 40 | m_CacheServerEnableTls: 0 41 | -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_VideoShadersIncludeMode: 2 32 | m_AlwaysIncludedShaders: 33 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} 40 | m_PreloadedShaders: [] 41 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 42 | m_CustomRenderPipeline: {fileID: 0} 43 | m_TransparencySortMode: 0 44 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 45 | m_DefaultRenderingPath: 1 46 | m_DefaultMobileRenderingPath: 1 47 | m_TierSettings: [] 48 | m_LightmapStripping: 0 49 | m_FogStripping: 0 50 | m_InstancingStripping: 0 51 | m_LightmapKeepPlain: 1 52 | m_LightmapKeepDirCombined: 1 53 | m_LightmapKeepDynamicPlain: 1 54 | m_LightmapKeepDynamicDirCombined: 1 55 | m_LightmapKeepShadowMask: 1 56 | m_LightmapKeepSubtractive: 1 57 | m_FogKeepLinear: 1 58 | m_FogKeepExp: 1 59 | m_FogKeepExp2: 1 60 | m_AlbedoSwatchInfos: [] 61 | m_LightsUseLinearIntensity: 0 62 | m_LightsUseColorTemperature: 0 63 | m_DefaultRenderingLayerMask: 1 64 | m_LogWhenShaderIsCompiled: 0 65 | -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | maxJobWorkers: 0 89 | preserveTilesOutsideBounds: 0 90 | debug: 91 | m_Flags: 0 92 | m_SettingNames: 93 | - Humanoid 94 | -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreReleasePackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | m_SeeAllPackageVersions: 0 20 | oneTimeWarningShown: 0 21 | m_Registries: 22 | - m_Id: main 23 | m_Name: 24 | m_Url: https://packages.unity.cn 25 | m_Scopes: [] 26 | m_IsDefault: 1 27 | m_Capabilities: 7 28 | m_UserSelectedRegistryName: 29 | m_UserAddingNewScopedRegistry: 0 30 | m_RegistryInfoDraft: 31 | m_Modified: 0 32 | m_ErrorMessage: 33 | m_UserModificationsInstanceId: -834 34 | m_OriginalInstanceId: -836 35 | m_LoadAssets: 0 36 | -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_SimulationMode: 0 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2021.3.32f1c1 2 | m_EditorVersionWithRevision: 2021.3.32f1c1 (fa19b96eeab7) 3 | -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 5 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | skinWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | customRenderPipeline: {fileID: 0} 44 | excludedTargetPlatforms: [] 45 | - serializedVersion: 2 46 | name: Low 47 | pixelLightCount: 0 48 | shadows: 0 49 | shadowResolution: 0 50 | shadowProjection: 1 51 | shadowCascades: 1 52 | shadowDistance: 20 53 | shadowNearPlaneOffset: 3 54 | shadowCascade2Split: 0.33333334 55 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 56 | shadowmaskMode: 0 57 | skinWeights: 2 58 | textureQuality: 0 59 | anisotropicTextures: 0 60 | antiAliasing: 0 61 | softParticles: 0 62 | softVegetation: 0 63 | realtimeReflectionProbes: 0 64 | billboardsFaceCameraPosition: 0 65 | vSyncCount: 0 66 | lodBias: 0.4 67 | maximumLODLevel: 0 68 | streamingMipmapsActive: 0 69 | streamingMipmapsAddAllCameras: 1 70 | streamingMipmapsMemoryBudget: 512 71 | streamingMipmapsRenderersPerFrame: 512 72 | streamingMipmapsMaxLevelReduction: 2 73 | streamingMipmapsMaxFileIORequests: 1024 74 | particleRaycastBudget: 16 75 | asyncUploadTimeSlice: 2 76 | asyncUploadBufferSize: 16 77 | asyncUploadPersistentBuffer: 1 78 | resolutionScalingFixedDPIFactor: 1 79 | customRenderPipeline: {fileID: 0} 80 | excludedTargetPlatforms: [] 81 | - serializedVersion: 2 82 | name: Medium 83 | pixelLightCount: 1 84 | shadows: 1 85 | shadowResolution: 0 86 | shadowProjection: 1 87 | shadowCascades: 1 88 | shadowDistance: 20 89 | shadowNearPlaneOffset: 3 90 | shadowCascade2Split: 0.33333334 91 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 92 | shadowmaskMode: 0 93 | skinWeights: 2 94 | textureQuality: 0 95 | anisotropicTextures: 1 96 | antiAliasing: 0 97 | softParticles: 0 98 | softVegetation: 0 99 | realtimeReflectionProbes: 0 100 | billboardsFaceCameraPosition: 0 101 | vSyncCount: 1 102 | lodBias: 0.7 103 | maximumLODLevel: 0 104 | streamingMipmapsActive: 0 105 | streamingMipmapsAddAllCameras: 1 106 | streamingMipmapsMemoryBudget: 512 107 | streamingMipmapsRenderersPerFrame: 512 108 | streamingMipmapsMaxLevelReduction: 2 109 | streamingMipmapsMaxFileIORequests: 1024 110 | particleRaycastBudget: 64 111 | asyncUploadTimeSlice: 2 112 | asyncUploadBufferSize: 16 113 | asyncUploadPersistentBuffer: 1 114 | resolutionScalingFixedDPIFactor: 1 115 | customRenderPipeline: {fileID: 0} 116 | excludedTargetPlatforms: [] 117 | - serializedVersion: 2 118 | name: High 119 | pixelLightCount: 2 120 | shadows: 2 121 | shadowResolution: 1 122 | shadowProjection: 1 123 | shadowCascades: 2 124 | shadowDistance: 40 125 | shadowNearPlaneOffset: 3 126 | shadowCascade2Split: 0.33333334 127 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 128 | shadowmaskMode: 1 129 | skinWeights: 2 130 | textureQuality: 0 131 | anisotropicTextures: 1 132 | antiAliasing: 0 133 | softParticles: 0 134 | softVegetation: 1 135 | realtimeReflectionProbes: 1 136 | billboardsFaceCameraPosition: 1 137 | vSyncCount: 1 138 | lodBias: 1 139 | maximumLODLevel: 0 140 | streamingMipmapsActive: 0 141 | streamingMipmapsAddAllCameras: 1 142 | streamingMipmapsMemoryBudget: 512 143 | streamingMipmapsRenderersPerFrame: 512 144 | streamingMipmapsMaxLevelReduction: 2 145 | streamingMipmapsMaxFileIORequests: 1024 146 | particleRaycastBudget: 256 147 | asyncUploadTimeSlice: 2 148 | asyncUploadBufferSize: 16 149 | asyncUploadPersistentBuffer: 1 150 | resolutionScalingFixedDPIFactor: 1 151 | customRenderPipeline: {fileID: 0} 152 | excludedTargetPlatforms: [] 153 | - serializedVersion: 2 154 | name: Very High 155 | pixelLightCount: 3 156 | shadows: 2 157 | shadowResolution: 2 158 | shadowProjection: 1 159 | shadowCascades: 2 160 | shadowDistance: 70 161 | shadowNearPlaneOffset: 3 162 | shadowCascade2Split: 0.33333334 163 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 164 | shadowmaskMode: 1 165 | skinWeights: 4 166 | textureQuality: 0 167 | anisotropicTextures: 2 168 | antiAliasing: 2 169 | softParticles: 1 170 | softVegetation: 1 171 | realtimeReflectionProbes: 1 172 | billboardsFaceCameraPosition: 1 173 | vSyncCount: 1 174 | lodBias: 1.5 175 | maximumLODLevel: 0 176 | streamingMipmapsActive: 0 177 | streamingMipmapsAddAllCameras: 1 178 | streamingMipmapsMemoryBudget: 512 179 | streamingMipmapsRenderersPerFrame: 512 180 | streamingMipmapsMaxLevelReduction: 2 181 | streamingMipmapsMaxFileIORequests: 1024 182 | particleRaycastBudget: 1024 183 | asyncUploadTimeSlice: 2 184 | asyncUploadBufferSize: 16 185 | asyncUploadPersistentBuffer: 1 186 | resolutionScalingFixedDPIFactor: 1 187 | customRenderPipeline: {fileID: 0} 188 | excludedTargetPlatforms: [] 189 | - serializedVersion: 2 190 | name: Ultra 191 | pixelLightCount: 4 192 | shadows: 2 193 | shadowResolution: 2 194 | shadowProjection: 1 195 | shadowCascades: 4 196 | shadowDistance: 150 197 | shadowNearPlaneOffset: 3 198 | shadowCascade2Split: 0.33333334 199 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 200 | shadowmaskMode: 1 201 | skinWeights: 255 202 | textureQuality: 0 203 | anisotropicTextures: 2 204 | antiAliasing: 2 205 | softParticles: 1 206 | softVegetation: 1 207 | realtimeReflectionProbes: 1 208 | billboardsFaceCameraPosition: 1 209 | vSyncCount: 1 210 | lodBias: 2 211 | maximumLODLevel: 0 212 | streamingMipmapsActive: 0 213 | streamingMipmapsAddAllCameras: 1 214 | streamingMipmapsMemoryBudget: 512 215 | streamingMipmapsRenderersPerFrame: 512 216 | streamingMipmapsMaxLevelReduction: 2 217 | streamingMipmapsMaxFileIORequests: 1024 218 | particleRaycastBudget: 4096 219 | asyncUploadTimeSlice: 2 220 | asyncUploadBufferSize: 16 221 | asyncUploadPersistentBuffer: 1 222 | resolutionScalingFixedDPIFactor: 1 223 | customRenderPipeline: {fileID: 0} 224 | excludedTargetPlatforms: [] 225 | m_PerPlatformDefaultQuality: 226 | Android: 2 227 | Lumin: 5 228 | Nintendo Switch: 5 229 | PS4: 5 230 | Stadia: 5 231 | Standalone: 5 232 | WebGL: 3 233 | Windows Store Apps: 5 234 | XboxOne: 5 235 | iPhone: 2 236 | tvOS: 2 237 | -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/SceneTemplateSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "templatePinStates": [], 3 | "dependencyTypeInfos": [ 4 | { 5 | "userAdded": false, 6 | "type": "UnityEngine.AnimationClip", 7 | "ignore": false, 8 | "defaultInstantiationMode": 0, 9 | "supportsModification": true 10 | }, 11 | { 12 | "userAdded": false, 13 | "type": "UnityEditor.Animations.AnimatorController", 14 | "ignore": false, 15 | "defaultInstantiationMode": 0, 16 | "supportsModification": true 17 | }, 18 | { 19 | "userAdded": false, 20 | "type": "UnityEngine.AnimatorOverrideController", 21 | "ignore": false, 22 | "defaultInstantiationMode": 0, 23 | "supportsModification": true 24 | }, 25 | { 26 | "userAdded": false, 27 | "type": "UnityEditor.Audio.AudioMixerController", 28 | "ignore": false, 29 | "defaultInstantiationMode": 0, 30 | "supportsModification": true 31 | }, 32 | { 33 | "userAdded": false, 34 | "type": "UnityEngine.ComputeShader", 35 | "ignore": true, 36 | "defaultInstantiationMode": 1, 37 | "supportsModification": true 38 | }, 39 | { 40 | "userAdded": false, 41 | "type": "UnityEngine.Cubemap", 42 | "ignore": false, 43 | "defaultInstantiationMode": 0, 44 | "supportsModification": true 45 | }, 46 | { 47 | "userAdded": false, 48 | "type": "UnityEngine.GameObject", 49 | "ignore": false, 50 | "defaultInstantiationMode": 0, 51 | "supportsModification": true 52 | }, 53 | { 54 | "userAdded": false, 55 | "type": "UnityEditor.LightingDataAsset", 56 | "ignore": false, 57 | "defaultInstantiationMode": 0, 58 | "supportsModification": false 59 | }, 60 | { 61 | "userAdded": false, 62 | "type": "UnityEngine.LightingSettings", 63 | "ignore": false, 64 | "defaultInstantiationMode": 0, 65 | "supportsModification": true 66 | }, 67 | { 68 | "userAdded": false, 69 | "type": "UnityEngine.Material", 70 | "ignore": false, 71 | "defaultInstantiationMode": 0, 72 | "supportsModification": true 73 | }, 74 | { 75 | "userAdded": false, 76 | "type": "UnityEditor.MonoScript", 77 | "ignore": true, 78 | "defaultInstantiationMode": 1, 79 | "supportsModification": true 80 | }, 81 | { 82 | "userAdded": false, 83 | "type": "UnityEngine.PhysicMaterial", 84 | "ignore": false, 85 | "defaultInstantiationMode": 0, 86 | "supportsModification": true 87 | }, 88 | { 89 | "userAdded": false, 90 | "type": "UnityEngine.PhysicsMaterial2D", 91 | "ignore": false, 92 | "defaultInstantiationMode": 0, 93 | "supportsModification": true 94 | }, 95 | { 96 | "userAdded": false, 97 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile", 98 | "ignore": false, 99 | "defaultInstantiationMode": 0, 100 | "supportsModification": true 101 | }, 102 | { 103 | "userAdded": false, 104 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessResources", 105 | "ignore": false, 106 | "defaultInstantiationMode": 0, 107 | "supportsModification": true 108 | }, 109 | { 110 | "userAdded": false, 111 | "type": "UnityEngine.Rendering.VolumeProfile", 112 | "ignore": false, 113 | "defaultInstantiationMode": 0, 114 | "supportsModification": true 115 | }, 116 | { 117 | "userAdded": false, 118 | "type": "UnityEditor.SceneAsset", 119 | "ignore": false, 120 | "defaultInstantiationMode": 0, 121 | "supportsModification": false 122 | }, 123 | { 124 | "userAdded": false, 125 | "type": "UnityEngine.Shader", 126 | "ignore": true, 127 | "defaultInstantiationMode": 1, 128 | "supportsModification": true 129 | }, 130 | { 131 | "userAdded": false, 132 | "type": "UnityEngine.ShaderVariantCollection", 133 | "ignore": true, 134 | "defaultInstantiationMode": 1, 135 | "supportsModification": true 136 | }, 137 | { 138 | "userAdded": false, 139 | "type": "UnityEngine.Texture", 140 | "ignore": false, 141 | "defaultInstantiationMode": 0, 142 | "supportsModification": true 143 | }, 144 | { 145 | "userAdded": false, 146 | "type": "UnityEngine.Texture2D", 147 | "ignore": false, 148 | "defaultInstantiationMode": 0, 149 | "supportsModification": true 150 | }, 151 | { 152 | "userAdded": false, 153 | "type": "UnityEngine.Timeline.TimelineAsset", 154 | "ignore": false, 155 | "defaultInstantiationMode": 0, 156 | "supportsModification": true 157 | } 158 | ], 159 | "defaultDependencyTypeInfo": { 160 | "userAdded": false, 161 | "type": "", 162 | "ignore": false, 163 | "defaultInstantiationMode": 1, 164 | "supportsModification": true 165 | }, 166 | "newSceneOverride": 0 167 | } -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_DashboardUrl: https://dashboard.unity3d.com 13 | m_CNEventUrl: https://cdp.cloud.unity.cn/v1/events 14 | m_CNConfigUrl: https://cdp.cloud.unity.cn/config 15 | m_TestInitMode: 0 16 | CrashReportingSettings: 17 | m_EventUrl: https://perf-events.cloud.unity.cn 18 | m_Enabled: 0 19 | m_LogBufferSize: 10 20 | m_CaptureEditorExceptions: 1 21 | UnityPurchasingSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | UnityAnalyticsSettings: 25 | m_Enabled: 1 26 | m_TestMode: 0 27 | m_InitializeOnStartup: 1 28 | UnityAdsSettings: 29 | m_Enabled: 0 30 | m_InitializeOnStartup: 1 31 | m_TestMode: 0 32 | m_IosGameId: 33 | m_AndroidGameId: 34 | m_GameIds: {} 35 | m_GameId: 36 | PerformanceReportingSettings: 37 | m_Enabled: 0 38 | -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | m_CompiledVersion: 0 14 | m_RuntimeVersion: 0 15 | -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /Example/UnityProject/ProjectSettings/boot.config: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gh-kL/GameConfig/f1fc10bf55efe3a042f5c249f3335dceeb1ee246/Example/UnityProject/ProjectSettings/boot.config -------------------------------------------------------------------------------- /Example/UnityProject/README.md: -------------------------------------------------------------------------------- 1 | 理论上用任何Unity版本打开都可以。 2 | 3 | 本实例主要展示了取出配置的值并输出在屏幕上。 -------------------------------------------------------------------------------- /README.MD: -------------------------------------------------------------------------------- 1 | # 游戏配置生成工具 2 | 3 | 在游戏开发中,**配置**是屡见不鲜的东西了。一个好的配置生成工具能让你在开发中事半功倍。 4 | 5 | 通常来说,**配置**都是由**策划**来产出,绝大多数**策划岗**都不了解开发,他们最喜欢的就是**Excel表格**(**Excel**的确是个好东西)。 6 | 7 | 本工具的主要功能就是把**Excel表格**导出成程序可用的数据。 8 | 9 | ## 特性 10 | - 支持横表、纵表、枚举表、枚举表。 11 | - 支持自定义语言配置脚本导出。(目前内置支持TS、C#,可自定义其它语言) 12 | - 表继承。(没错,就是那个**面向对象**中的**继承**) 13 | - 多主键。 14 | - 表连接。 15 | - 增量发布。 16 | - ...在路上! 17 | 18 | --- 19 | 20 | ## 快速开始 21 | 22 | 1. 拉取本仓库到本地。 23 | 2. 安装依赖: 24 | 25 | 安装 [Node.js LTS版](https://nodejs.org/en/)(最后测试基于*20.11.0*)。 26 | 27 | 打开`命令行`,将目录定位到 `Config/Generator` 目录。 28 | 29 | 在`命令行`中执行命令: `npm i`,可能会有警告,但没关系,忽略即可。 30 | 31 | 3. 根据你的喜好打开`Example`中的`UnityProject(Unity示例项目)`或`CCCProject(Cocos Creator示例项目)`。 32 | 4. 运行示例场景。 33 | 34 | > 完成上述步骤,你就看到**配置被输出在屏幕上**,下一步就需要了解如何配表并导出,请查看**详细文档**([中文链接](https://github.com/gh-kL/GameConfig/blob/main/Config/README.MD))。 35 | 36 | ## 已知问题 37 | 38 | 1. 未测试过多主键继承,可能会报错。 39 | 40 | --- 41 | 42 | Author: kL 43 | 44 | E-mail: *klk0@qq.com* 45 | 46 | --- 47 | --------------------------------------------------------------------------------