@cc-component/cc-core 1.2.6 → 1.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/assets/core/config/CommonEnum.ts +1 -0
  2. package/assets/core/config/CommonEnum.ts.meta +1 -1
  3. package/assets/core/config/IConfig.ts.meta +1 -1
  4. package/assets/core/config/LayerType.ts.meta +1 -1
  5. package/assets/core/config/LayerUI.ts +2 -2
  6. package/assets/core/config/LayerUI.ts.meta +1 -1
  7. package/assets/core/config.meta +1 -1
  8. package/assets/core/editor/LanguageManager.ts +1 -1
  9. package/assets/core/editor/LanguageManager.ts.meta +1 -1
  10. package/assets/core/editor/SpineRunner.ts.meta +1 -1
  11. package/assets/core/editor/i18nEditorComponent.ts +8 -8
  12. package/assets/core/editor/i18nEditorComponent.ts.meta +1 -1
  13. package/assets/core/editor.meta +1 -1
  14. package/assets/core/home/AudioUtil.ts +5 -11
  15. package/assets/core/home/AudioUtil.ts.meta +1 -1
  16. package/assets/core/home/BaseBoxView.ts +1 -1
  17. package/assets/core/home/BaseBoxView.ts.meta +1 -1
  18. package/assets/core/home/BaseLaunchComponent.ts.meta +1 -1
  19. package/assets/core/home/BaseLoading.ts +14 -14
  20. package/assets/core/home/BaseLoading.ts.meta +1 -1
  21. package/assets/core/home/BaseModuleConfig.ts +24 -3
  22. package/assets/core/home/BaseModuleConfig.ts.meta +1 -1
  23. package/assets/core/home/BaseSkeleton.ts.meta +1 -1
  24. package/assets/core/home/CameraAngel.ts.meta +1 -1
  25. package/assets/core/home/DouYinShow.ts +1 -1
  26. package/assets/core/home/DouYinShow.ts.meta +1 -1
  27. package/assets/core/home/EventManager.ts +2 -10
  28. package/assets/core/home/EventManager.ts.meta +1 -1
  29. package/assets/core/home/FollowCamera.ts.meta +1 -1
  30. package/assets/core/home/InViewCenter.ts.meta +1 -1
  31. package/assets/core/home/LoadingWindow.ts.meta +1 -1
  32. package/assets/core/home/ParabolaTween.ts.meta +1 -1
  33. package/assets/core/home/ProgessWindow.ts.meta +1 -1
  34. package/assets/core/home/Quaternion.ts.meta +1 -1
  35. package/assets/core/home/ResUtil.ts.meta +1 -1
  36. package/assets/core/home/ResourceManager.ts.meta +1 -1
  37. package/assets/core/home/StateMachine.ts.meta +1 -1
  38. package/assets/core/home/StorageManager.ts.meta +1 -1
  39. package/assets/core/home/ThirdFreeLookCamera.ts.meta +1 -1
  40. package/assets/core/home/TimeManager.ts.meta +1 -1
  41. package/assets/core/home/Tools.ts +209 -0
  42. package/assets/core/home/Tools.ts.meta +1 -1
  43. package/assets/core/home/util/EncryptUtil.ts.meta +1 -1
  44. package/assets/core/home/util/MathUtil.ts.meta +1 -1
  45. package/assets/core/home/util/Md5.ts.meta +1 -1
  46. package/assets/core/home/util/RandomUtil.ts.meta +1 -1
  47. package/assets/core/home/util/ResUtil.ts.meta +1 -1
  48. package/assets/core/home/util/crypto-js.d.ts.meta +1 -1
  49. package/assets/core/home/util/crypto-js.js.meta +1 -1
  50. package/assets/core/home/util.meta +1 -1
  51. package/assets/core/home.meta +1 -1
  52. package/assets/core/interface/App.ts +545 -0
  53. package/assets/core/{home/ExView.ts.meta → interface/App.ts.meta} +1 -1
  54. package/assets/core/interface/ISceneParam.ts.meta +1 -1
  55. package/assets/core/interface/Interface.ts +58 -77
  56. package/assets/core/interface/Interface.ts.meta +1 -1
  57. package/assets/core/interface.meta +1 -1
  58. package/assets/core/lib/language/Language.ts.meta +1 -1
  59. package/assets/core/lib/language/LanguageData.ts +2 -2
  60. package/assets/core/lib/language/LanguageData.ts.meta +1 -1
  61. package/assets/core/lib/language/LanguageLabel.ts +4 -4
  62. package/assets/core/lib/language/LanguageLabel.ts.meta +1 -1
  63. package/assets/core/lib/language/LanguagePack.ts +4 -4
  64. package/assets/core/lib/language/LanguagePack.ts.meta +1 -1
  65. package/assets/core/lib/language/LanguagePointLabel.ts.meta +1 -1
  66. package/assets/core/lib/language/LanguageSpine.ts +1 -1
  67. package/assets/core/lib/language/LanguageSpine.ts.meta +1 -1
  68. package/assets/core/lib/language/LanguageSprite.ts +6 -6
  69. package/assets/core/lib/language/LanguageSprite.ts.meta +1 -1
  70. package/assets/core/lib/language.meta +1 -1
  71. package/assets/core/lib/logger/ELoggerLevel.ts.meta +1 -1
  72. package/assets/core/lib/logger/MLogger.ts.meta +1 -1
  73. package/assets/core/lib/logger.meta +1 -1
  74. package/assets/core/lib/net/libs/proto/output/protobuf.d.ts.meta +1 -1
  75. package/assets/core/lib/net/libs/proto/output/protobuf.min.js.meta +1 -1
  76. package/assets/core/lib/net/libs/proto/output/protobuf_custom.d.ts.meta +1 -1
  77. package/assets/core/lib/net/libs/proto/output/protobuf_custom.js.meta +1 -1
  78. package/assets/core/lib/net/libs/proto/output.meta +1 -1
  79. package/assets/core/lib/net/libs/proto/source/Cmd.proto.meta +1 -1
  80. package/assets/core/lib/net/libs/proto/source/UserLogin.proto.meta +1 -1
  81. package/assets/core/lib/net/libs/proto/source/base.proto.meta +1 -1
  82. package/assets/core/lib/net/libs/proto/source/command.proto.meta +1 -1
  83. package/assets/core/lib/net/libs/proto/source/domain/boos_battle_info.proto.meta +1 -1
  84. package/assets/core/lib/net/libs/proto/source/domain/player_auth.proto.meta +1 -1
  85. package/assets/core/lib/net/libs/proto/source/domain.meta +1 -1
  86. package/assets/core/lib/net/libs/proto/source/message/game_push.proto.meta +1 -1
  87. package/assets/core/lib/net/libs/proto/source/message/game_request.proto.meta +1 -1
  88. package/assets/core/lib/net/libs/proto/source/message/game_response.proto.meta +1 -1
  89. package/assets/core/lib/net/libs/proto/source/message.meta +1 -1
  90. package/assets/core/lib/net/libs/proto/source/push/boss_battle_events.proto.meta +1 -1
  91. package/assets/core/lib/net/libs/proto/source/push.meta +1 -1
  92. package/assets/core/lib/net/libs/proto/source.meta +1 -1
  93. package/assets/core/lib/net/libs/proto.meta +1 -1
  94. package/assets/core/lib/net/libs.meta +1 -1
  95. package/assets/core/lib/net/net/HttpManager.ts.meta +1 -1
  96. package/assets/core/lib/net/net/NetInterface.ts.meta +1 -1
  97. package/assets/core/lib/net/net/NetManager.ts.meta +1 -1
  98. package/assets/core/lib/net/net/NetNode.ts.meta +1 -1
  99. package/assets/core/lib/net/net/WebSock.ts.meta +1 -1
  100. package/assets/core/lib/net/net/custom/NetChannelManager.ts.meta +1 -1
  101. package/assets/core/lib/net/net/custom/NetConfig.ts.meta +1 -1
  102. package/assets/core/lib/net/net/custom/NetErrorCode.ts.meta +1 -1
  103. package/assets/core/lib/net/net/custom/NetGameTips.ts.meta +1 -1
  104. package/assets/core/lib/net/net/custom/NetNodeGame.ts.meta +1 -1
  105. package/assets/core/lib/net/net/custom.meta +1 -1
  106. package/assets/core/lib/net/net/protocol/NetProtocolJson.ts.meta +1 -1
  107. package/assets/core/lib/net/net/protocol/NetProtocolProtobuf.ts.meta +1 -1
  108. package/assets/core/lib/net/net/protocol.meta +1 -1
  109. package/assets/core/lib/net/net.meta +1 -1
  110. package/assets/core/lib/net/prompt.meta +1 -1
  111. package/assets/core/lib/net.meta +1 -1
  112. package/assets/core/lib/old.meta +1 -1
  113. package/assets/core/lib/tabbar/TabBarComponent.ts.meta +1 -1
  114. package/assets/core/lib/tabbar/TabBarController.ts.meta +1 -1
  115. package/assets/core/lib/tabbar/TabBarItem.ts.meta +1 -1
  116. package/assets/core/lib/tabbar.meta +1 -1
  117. package/assets/core/lib.meta +1 -1
  118. package/assets/core.meta +1 -1
  119. package/assets.meta +1 -1
  120. package/index.ts.meta +1 -1
  121. package/package.json +1 -1
  122. package/package.json.meta +1 -1
  123. package/assets/core/home/ExView.ts +0 -9
  124. package/assets/core/home/JsonUtil.ts +0 -102
  125. package/assets/core/home/JsonUtil.ts.meta +0 -9
  126. package/assets/core/home/prefabs.meta +0 -12
  127. package/assets/core/interface/MainModule.ts +0 -1029
  128. package/assets/core/interface/MainModule.ts.meta +0 -9
@@ -2,7 +2,7 @@
2
2
  "ver": "1.2.0",
3
3
  "importer": "directory",
4
4
  "imported": true,
5
- "uuid": "25ee18de-ff6f-43e1-bee4-d342a08cdfb9",
5
+ "uuid": "5aee32d3-975a-4afc-96eb-545be836f472",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "1.2.0",
3
3
  "importer": "directory",
4
4
  "imported": true,
5
- "uuid": "c5aff8e1-992b-41fa-802b-ac5692bcf9ef",
5
+ "uuid": "a9ae6f24-7e9a-4975-95b1-8b00fa08df43",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {
@@ -2,7 +2,7 @@
2
2
  "ver": "1.2.0",
3
3
  "importer": "directory",
4
4
  "imported": true,
5
- "uuid": "b619fb46-6e26-4842-a8ca-363d9136f629",
5
+ "uuid": "b2c3a7e9-ee2c-4b20-8df0-ca86880e5f4c",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "1.2.0",
3
3
  "importer": "directory",
4
4
  "imported": true,
5
- "uuid": "8414e4ad-c3ab-4a49-8b9a-8fc9c935dd7c",
5
+ "uuid": "4324ba25-9540-4cd8-8e63-fe982767af30",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "4.0.24",
3
3
  "importer": "typescript",
4
4
  "imported": true,
5
- "uuid": "42b714af-f09e-4aba-94f8-0033dd8a1321",
5
+ "uuid": "7a410a72-518e-4a0d-89e2-0a2e33d0eddb",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "4.0.24",
3
3
  "importer": "typescript",
4
4
  "imported": true,
5
- "uuid": "30df3d0f-b563-43c6-8a8c-59e4fd5652b0",
5
+ "uuid": "60e7847d-69e1-42a2-bff4-52bedbb4012b",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "4.0.24",
3
3
  "importer": "typescript",
4
4
  "imported": true,
5
- "uuid": "4e807495-5d3d-4a54-bffb-85196cfa2489",
5
+ "uuid": "634ec195-a543-433e-a365-3fc0184ab964",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "4.0.24",
3
3
  "importer": "typescript",
4
4
  "imported": true,
5
- "uuid": "e7d169e6-a1fb-4216-a01e-96acda541c6f",
5
+ "uuid": "8b63b153-6aa2-402d-ba89-00bd4d6cab8a",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "4.0.24",
3
3
  "importer": "typescript",
4
4
  "imported": true,
5
- "uuid": "cc0b4757-b227-4bbb-8cfe-5df29532f1b7",
5
+ "uuid": "fd6723cd-96ff-4dde-a559-d1d48b056e5b",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "4.0.24",
3
3
  "importer": "typescript",
4
4
  "imported": true,
5
- "uuid": "ac861aa1-8743-466a-9fc6-d36e1b13ad94",
5
+ "uuid": "ed715e24-08b4-4a37-b866-ca28e9a85b2f",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "4.0.24",
3
3
  "importer": "typescript",
4
4
  "imported": true,
5
- "uuid": "de66c7dd-a7e3-4f76-84ea-97c4cafc43cf",
5
+ "uuid": "9e91090d-c89c-48fc-9797-52cbc4bdaebe",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "4.0.24",
3
3
  "importer": "typescript",
4
4
  "imported": true,
5
- "uuid": "e0963301-1c82-429e-b1e1-c991aa324211",
5
+ "uuid": "682cfce4-5fbc-4e84-a82c-f32a55130ace",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "4.0.24",
3
3
  "importer": "typescript",
4
4
  "imported": true,
5
- "uuid": "446e8905-8cfa-49c2-af78-5c60459754dc",
5
+ "uuid": "dd3605e2-606d-4523-af2d-79f7c8b8695f",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "4.0.24",
3
3
  "importer": "typescript",
4
4
  "imported": true,
5
- "uuid": "bcdefa1e-679e-4d17-96f4-f5c25417a5e2",
5
+ "uuid": "741fdb26-b7c5-4a5e-9847-cf263e84f7b4",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "1.2.0",
3
3
  "importer": "directory",
4
4
  "imported": true,
5
- "uuid": "7cd38610-8bc0-424d-be94-a0c93770304b",
5
+ "uuid": "521de43e-8342-442c-bf52-0765f3ffd59f",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "4.0.24",
3
3
  "importer": "typescript",
4
4
  "imported": true,
5
- "uuid": "ef0b1e0c-f9a8-40c0-81d0-f64049599bff",
5
+ "uuid": "245e7a4f-60f6-4240-b02c-b516af592916",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "4.0.24",
3
3
  "importer": "typescript",
4
4
  "imported": true,
5
- "uuid": "00b03846-5045-4dd8-92ed-28e98179b863",
5
+ "uuid": "8a3b5a19-5297-4ef3-8e94-60cfc572af79",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "1.2.0",
3
3
  "importer": "directory",
4
4
  "imported": true,
5
- "uuid": "3063c4b0-90d0-43f6-bff2-5fd2b11054b5",
5
+ "uuid": "42c511aa-1aaa-4a4e-b9aa-2a1cebb10982",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "1.2.0",
3
3
  "importer": "directory",
4
4
  "imported": true,
5
- "uuid": "3a1732a0-fa1f-44a5-a2cb-e07ae9ea7c6b",
5
+ "uuid": "0fa83dbd-3e47-41d5-8ee9-16890c14e2f9",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "1.2.0",
3
3
  "importer": "directory",
4
4
  "imported": true,
5
- "uuid": "a3d34cc7-df4f-4928-85c4-e55b44f9b76f",
5
+ "uuid": "41bbf772-00ea-403a-9ced-b419c7bc1622",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "1.2.0",
3
3
  "importer": "directory",
4
4
  "imported": true,
5
- "uuid": "5f47f111-187e-44ff-83bd-f51698fc389b",
5
+ "uuid": "0f7b6a3f-3d95-4efb-a44d-f594171bdd2f",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "1.2.0",
3
3
  "importer": "directory",
4
4
  "imported": true,
5
- "uuid": "72fe6f43-b640-4a13-97a1-bf8cd014be48",
5
+ "uuid": "b6e6a2af-7981-45ca-b48e-be71a3e0c1df",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "4.0.24",
3
3
  "importer": "typescript",
4
4
  "imported": true,
5
- "uuid": "b8cbcf1b-4d1a-4da9-8611-f35d1fe8812b",
5
+ "uuid": "67a9e5c3-272e-41bf-885f-ea74d5212bd8",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "4.0.24",
3
3
  "importer": "typescript",
4
4
  "imported": true,
5
- "uuid": "bf47bf0e-82f7-4af2-bd19-bff5f42513e5",
5
+ "uuid": "dd917dae-2d09-4a62-be87-c5beb1f1c0d3",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "4.0.24",
3
3
  "importer": "typescript",
4
4
  "imported": true,
5
- "uuid": "ec28ffc3-182f-4849-bce0-71fe6ee7a792",
5
+ "uuid": "6615aebf-0dc6-4b58-adcc-793b72b5c45a",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "1.2.0",
3
3
  "importer": "directory",
4
4
  "imported": true,
5
- "uuid": "d4b001b9-1789-40d0-b742-9a17748e3ef8",
5
+ "uuid": "aabe7690-bb16-44b2-889a-7c76e47c4f48",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
@@ -2,7 +2,7 @@
2
2
  "ver": "1.2.0",
3
3
  "importer": "directory",
4
4
  "imported": true,
5
- "uuid": "128646f0-7d00-4324-99f8-e6a6728f5e54",
5
+ "uuid": "67ef91df-ddfa-49db-8019-53f99060b81a",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {
package/assets/core.meta CHANGED
@@ -2,7 +2,7 @@
2
2
  "ver": "1.2.0",
3
3
  "importer": "directory",
4
4
  "imported": true,
5
- "uuid": "59c0daf9-a123-4365-adf5-4798aa754636",
5
+ "uuid": "32a5bbf9-f8ff-4665-8a25-801e09caa35b",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
package/assets.meta CHANGED
@@ -2,7 +2,7 @@
2
2
  "ver": "1.2.0",
3
3
  "importer": "directory",
4
4
  "imported": true,
5
- "uuid": "eaf5bea5-6b92-4d35-92ff-dd5a4164e092",
5
+ "uuid": "6b23d7a5-a52b-4c4b-8f1b-bfaa72fbfcd3",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
package/index.ts.meta CHANGED
@@ -2,7 +2,7 @@
2
2
  "ver": "4.0.24",
3
3
  "importer": "typescript",
4
4
  "imported": true,
5
- "uuid": "df5d096e-3cdf-4505-9d1d-03110324c44d",
5
+ "uuid": "7a336b7d-79a3-48ef-9451-d925e367809b",
6
6
  "files": [],
7
7
  "subMetas": {},
8
8
  "userData": {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cc-component/cc-core",
3
- "version": "1.2.6",
3
+ "version": "1.2.9",
4
4
  "engine": ">=3.8.6",
5
5
  "description": "系统组件添加常用扩展方法",
6
6
  "main": "index.ts",
package/package.json.meta CHANGED
@@ -2,7 +2,7 @@
2
2
  "ver": "2.0.1",
3
3
  "importer": "json",
4
4
  "imported": true,
5
- "uuid": "1f1686a7-50ff-42d0-917b-8c4a08d96c1a",
5
+ "uuid": "561e76c1-e517-4977-ac87-442704e3de8f",
6
6
  "files": [
7
7
  ".json"
8
8
  ],
@@ -1,9 +0,0 @@
1
- import { BaseBoxView } from "./BaseBoxView";
2
-
3
-
4
- // 扩展 Node 接口,声明自定义属性
5
- declare module 'cc' {
6
- interface Node {
7
- BoxView: BaseBoxView;
8
- }
9
- }
@@ -1,102 +0,0 @@
1
- import { assetManager } from "cc";
2
- import { JsonAsset, resources, AssetManager, director } from "cc";
3
-
4
- export class JsonUtil {
5
-
6
- data: Map<string, any> = new Map();
7
- dataMap: Map<string, any> = new Map();
8
-
9
- static _instance: JsonUtil;
10
- static get instance(): JsonUtil {
11
- if (!this._instance) {
12
- this._instance = new JsonUtil();
13
- }
14
- return this._instance;
15
- }
16
-
17
- static get(tabName: string) {
18
- return JsonUtil.instance.data.get(tabName);
19
- }
20
-
21
- // static getMap<T>() {
22
- // const map = new Map<number, T>();
23
- // const data = JsonUtil.get(T.TableName)
24
- // for (const key in data) {
25
- // if (data.hasOwnProperty(key)) {
26
- // let id = parseInt(key);
27
- // map.set(id, new T(id))
28
- // }
29
- // }
30
- // return map;
31
- // }
32
-
33
- static getMap<T>(table_name: string, is_copy: boolean = false): Map<number, T> {
34
- // 使用构造函数名称作为键值
35
- const constructorName = table_name;
36
- if (is_copy) {
37
- return JSON.parse(JSON.stringify(JsonUtil.getMap(table_name, false)))
38
- }
39
- else if (JsonUtil.instance.dataMap.has(constructorName)) {
40
- return JsonUtil.instance.dataMap.get(constructorName);
41
- } else {
42
- console.error('没有这个表', table_name)
43
- return null;
44
- }
45
- }
46
- async loadJsonAll(bundleName, path: string) {
47
- if (!this.data.has(bundleName)) {
48
- await this.loadAllJsonAssets(bundleName, path)
49
- }
50
- }
51
-
52
- async loadLanguage(bundleName, path: string) {
53
- await this.loadAllJsonAssets(bundleName, path)
54
- const bundle: AssetManager.Bundle | null = assetManager.getBundle(bundleName);
55
- console.error('json===', this.data)
56
- }
57
-
58
-
59
- /**
60
- * 从指定的bundle中加载文件夹中的所有JsonAsset资源 (3.x语法)
61
- * @param bundleName bundle名称
62
- * @param path 文件夹路径(相对于bundle目录)
63
- * @returns 返回Promise<JsonAsset[]>,包含文件夹中所有JSON资源
64
- */
65
- private loadAllJsonAssets(bundleName: string, path: string): Promise<Map<string, any>> {
66
- return new Promise((resolve, reject) => {
67
- const bundle: AssetManager.Bundle | null = assetManager.getBundle(bundleName);
68
- if (bundle) {
69
- bundle.loadDir(path, JsonAsset, (err: Error | null, assets: JsonAsset[]) => {
70
- if (err) {
71
- reject(err);
72
- } else {
73
- assets.forEach(asset => {
74
- this.data.set(asset.name, asset.json);
75
- const constructorName = `${asset.name}`
76
- const map = new Map<number, any>();
77
- const data = JsonUtil.get(constructorName);
78
- if (data) {
79
- for (const key in data) {
80
- if (data.hasOwnProperty(key)) {
81
- let id = parseInt(key);
82
- data[key].id = id;
83
- map.set(id, data[key]);
84
- }
85
- }
86
- }
87
- JsonUtil.instance.dataMap.set(constructorName, map);
88
- });
89
-
90
-
91
-
92
- resolve(this.data);
93
- }
94
- });
95
- } else {
96
- reject(new Error(`报错了 '${bundleName}' not found`));
97
- }
98
- });
99
- }
100
-
101
-
102
- }
@@ -1,9 +0,0 @@
1
- {
2
- "ver": "4.0.24",
3
- "importer": "typescript",
4
- "imported": true,
5
- "uuid": "afbb49b0-2735-4364-a508-893fc085454b",
6
- "files": [],
7
- "subMetas": {},
8
- "userData": {}
9
- }
@@ -1,12 +0,0 @@
1
- {
2
- "ver": "1.2.0",
3
- "importer": "directory",
4
- "imported": true,
5
- "uuid": "9cd4d838-4fc3-4219-b8c4-d9f14eae73bf",
6
- "files": [],
7
- "subMetas": {},
8
- "userData": {
9
- "compressionType": {},
10
- "isRemoteBundle": {}
11
- }
12
- }