test.ts 970 B

12345678910111213141516171819202122232425262728293031
  1. import { ConfigMgr } from "../Script/game/cfg/configMgr";
  2. import { Utils } from "../Script/game/common/utils";
  3. const {ccclass, property} = cc._decorator;
  4. @ccclass
  5. export default class test extends cc.Component {
  6. /*===========================自动绑定组件开始===========================*/
  7. /*===========================自动绑定组件结束===========================*/
  8. /*===========================自动生成按钮事件开始==========================*/
  9. /*===========================自动生成按钮事件结束==========================*/
  10. protected onLoad(): void {
  11. // this.testCfg();
  12. // let str = '[4;5]';
  13. // str = Utils.strReplaceSeparator(str);
  14. // let obj = JSON.parse(str);
  15. // console.log(obj);
  16. let obj = Utils.strToJson('[[101;1][102;1][103;1]]');
  17. console.log(obj);
  18. }
  19. async testCfg(){
  20. await ConfigMgr.inst.init();
  21. }
  22. }