@nice2dev/game-engine 1.3.14 → 1.3.16

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 (434) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/accessibility/Accessibility.js +152 -165
  3. package/dist/cjs/ai/AI.js +292 -294
  4. package/dist/cjs/ai/BehaviorTree.js +1029 -1113
  5. package/dist/cjs/ai/StateMachine.js +694 -756
  6. package/dist/cjs/animation/Animation.js +232 -241
  7. package/dist/cjs/audio/AudioAdvanced.js +221 -236
  8. package/dist/cjs/audio/AudioBridge.js +441 -435
  9. package/dist/cjs/audio/AudioManager.js +242 -259
  10. package/dist/cjs/build-cloud/BuildOrchestration.js +1059 -1098
  11. package/dist/cjs/build-cloud/GodotBuildCloud.js +641 -670
  12. package/dist/cjs/build-cloud/UnityBuildCloud.js +563 -610
  13. package/dist/cjs/build-cloud/UnrealBuildCloud.js +610 -635
  14. package/dist/cjs/core/EventBus.js +51 -56
  15. package/dist/cjs/core/GameClock.js +62 -66
  16. package/dist/cjs/core/GameConfig.js +72 -79
  17. package/dist/cjs/core/GameLoop.js +80 -89
  18. package/dist/cjs/core/ServiceLocator.js +61 -65
  19. package/dist/cjs/core/Validation.js +72 -82
  20. package/dist/cjs/core/math.js +108 -112
  21. package/dist/cjs/devtools/DevTools.js +542 -563
  22. package/dist/cjs/devtools/DeveloperExperience.js +521 -559
  23. package/dist/cjs/devtools/GameplayAnalytics.js +636 -646
  24. package/dist/cjs/dialogue/DialogueSystem.js +984 -986
  25. package/dist/cjs/docs/DocGenerator.js +339 -364
  26. package/dist/cjs/ecs/World.js +355 -371
  27. package/dist/cjs/editor/AchievementEditor.js +580 -636
  28. package/dist/cjs/editor/AdvancedEditor.js +184 -191
  29. package/dist/cjs/editor/AnimationRetargeting.js +696 -741
  30. package/dist/cjs/editor/AssetBrowser.js +1072 -1160
  31. package/dist/cjs/editor/AssetManager.js +187 -192
  32. package/dist/cjs/editor/ConsolePro.js +971 -1061
  33. package/dist/cjs/editor/CraftingEditor.js +680 -730
  34. package/dist/cjs/editor/DebugTools.js +187 -185
  35. package/dist/cjs/editor/DialogueSystem.js +844 -901
  36. package/dist/cjs/editor/LeaderboardSystem.js +429 -483
  37. package/dist/cjs/editor/NiceGameEditor.js +1903 -1201
  38. package/dist/cjs/editor/PrefabSystem.js +772 -838
  39. package/dist/cjs/editor/ProfilerPanel.js +649 -700
  40. package/dist/cjs/editor/QuestEditor.js +792 -839
  41. package/dist/cjs/editor/ReplaySystem.js +585 -634
  42. package/dist/cjs/editor/SceneEditor.js +176 -200
  43. package/dist/cjs/editor/ScreenshotMode.js +621 -688
  44. package/dist/cjs/editor/ShaderGraph.js +1556 -1582
  45. package/dist/cjs/editor/TimelineEditor.js +715 -778
  46. package/dist/cjs/editor/UndoRedoPro.js +830 -904
  47. package/dist/cjs/editor/VRARMode.js +582 -645
  48. package/dist/cjs/engine/NiceGameEngine.js +141 -164
  49. package/dist/cjs/engine/SaveSystem.js +441 -495
  50. package/dist/cjs/enterprise/Enterprise.js +254 -261
  51. package/dist/cjs/export/BevyExporter.js +927 -967
  52. package/dist/cjs/export/CocosExporter.js +644 -673
  53. package/dist/cjs/export/Construct3Exporter.js +783 -794
  54. package/dist/cjs/export/DefoldExporter.js +1028 -1069
  55. package/dist/cjs/export/GDevelopExporter.js +674 -708
  56. package/dist/cjs/export/GameMakerExporter.js +791 -805
  57. package/dist/cjs/export/GodotExporter.js +1003 -1045
  58. package/dist/cjs/export/MinecraftBedrockExporter.js +573 -578
  59. package/dist/cjs/export/MonoGameExporter.js +1265 -1293
  60. package/dist/cjs/export/Pico8Exporter.js +766 -812
  61. package/dist/cjs/export/PlatformExporter.js +188 -206
  62. package/dist/cjs/export/RPGMakerExporter.js +860 -879
  63. package/dist/cjs/export/RobloxExporter.js +883 -919
  64. package/dist/cjs/export/Solar2DExporter.js +1218 -1256
  65. package/dist/cjs/export/ThreeJSExporter.js +1006 -1073
  66. package/dist/cjs/export/Tic80Exporter.js +1210 -1267
  67. package/dist/cjs/export/UnityExporter.js +1116 -1131
  68. package/dist/cjs/export/UnrealExporter.js +889 -919
  69. package/dist/cjs/export/WebExporter.js +931 -970
  70. package/dist/cjs/export/index.js +42 -65
  71. package/dist/cjs/godot-integration/GodotAssetLibrary.js +659 -692
  72. package/dist/cjs/godot-integration/GodotImport.js +929 -1027
  73. package/dist/cjs/godot-integration/GodotLiveLink.js +915 -945
  74. package/dist/cjs/godot-integration/components/GodotProjectBrowser.js +911 -611
  75. package/dist/cjs/i18n/I18n.js +860 -900
  76. package/dist/cjs/i18n/useTranslation.js +84 -89
  77. package/dist/cjs/import/AsepriteImporter.js +658 -716
  78. package/dist/cjs/import/DragonBonesImporter.js +437 -461
  79. package/dist/cjs/import/GameMakerImporter.js +511 -521
  80. package/dist/cjs/import/GodotSceneImporter.js +788 -822
  81. package/dist/cjs/import/LDtkImporter.js +436 -454
  82. package/dist/cjs/import/Live2DImporter.js +497 -518
  83. package/dist/cjs/import/NdgFormat.js +424 -457
  84. package/dist/cjs/import/OgmoImporter.js +466 -493
  85. package/dist/cjs/import/RPGMakerImporter.js +451 -477
  86. package/dist/cjs/import/SceneImporter.js +378 -423
  87. package/dist/cjs/import/SpineImporter.js +511 -546
  88. package/dist/cjs/import/SpriterImporter.js +590 -613
  89. package/dist/cjs/import/TiledMapImporter.js +811 -846
  90. package/dist/cjs/import/UnitySceneImporter.js +687 -703
  91. package/dist/cjs/import/index.js +206 -251
  92. package/dist/cjs/index.js +275 -278
  93. package/dist/cjs/input/GamepadNavigation.js +185 -205
  94. package/dist/cjs/input/InputManager.js +397 -421
  95. package/dist/cjs/input/useGamepads.js +70 -81
  96. package/dist/cjs/integration/IconSprite.js +129 -256
  97. package/dist/cjs/inventory/InventorySystem.js +920 -995
  98. package/dist/cjs/kids/KidMode.js +997 -1022
  99. package/dist/cjs/kids/KidTools.js +570 -594
  100. package/dist/cjs/monetization/Monetization.js +170 -177
  101. package/dist/cjs/multiplayer/LocalMultiplayer.js +287 -287
  102. package/dist/cjs/multiplayer/MiniGameTypes.js +49 -59
  103. package/dist/cjs/native-engine/AnimationSystem.js +731 -806
  104. package/dist/cjs/native-engine/AssetPipeline.js +454 -515
  105. package/dist/cjs/native-engine/AudioEngine.js +763 -804
  106. package/dist/cjs/native-engine/InputSystem.js +1075 -1145
  107. package/dist/cjs/native-engine/NetworkingSystem.js +733 -793
  108. package/dist/cjs/native-engine/PhysicsEngine.js +583 -607
  109. package/dist/cjs/native-engine/RenderingEngine.js +302 -350
  110. package/dist/cjs/native-engine/SceneGraph.js +769 -808
  111. package/dist/cjs/network/MultiplayerTransport.js +97 -132
  112. package/dist/cjs/network/Networking.js +549 -564
  113. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/AbortController.js +21 -29
  114. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/AccessTokenHttpClient.js +40 -48
  115. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/DefaultHttpClient.js +35 -43
  116. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/DefaultReconnectPolicy.js +10 -15
  117. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/Errors.js +103 -135
  118. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/FetchHttpClient.js +131 -158
  119. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HandshakeProtocol.js +39 -53
  120. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HeaderNames.js +5 -8
  121. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HttpClient.js +40 -48
  122. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HttpConnection.js +494 -572
  123. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HubConnection.js +826 -953
  124. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HubConnectionBuilder.js +125 -146
  125. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/IHubProtocol.js +13 -23
  126. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/ILogger.js +11 -25
  127. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/ITransport.js +13 -24
  128. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/JsonHubProtocol.js +108 -121
  129. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/Loggers.js +10 -14
  130. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/LongPollingTransport.js +150 -185
  131. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/MessageBuffer.js +158 -196
  132. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/ServerSentEventsTransport.js +90 -105
  133. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/Subject.js +30 -35
  134. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/TextMessageFormat.js +16 -21
  135. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/Utils.js +215 -248
  136. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/WebSocketTransport.js +135 -157
  137. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/XhrHttpClient.js +76 -85
  138. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/index.js +24 -27
  139. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/pkg-version.js +3 -4
  140. package/dist/cjs/pathfinding/Pathfinding.js +245 -263
  141. package/dist/cjs/performance/AssetStreaming.js +561 -635
  142. package/dist/cjs/performance/BenchmarkSuite.js +283 -311
  143. package/dist/cjs/performance/DeltaCompression.js +467 -526
  144. package/dist/cjs/performance/DeterministicPhysics.js +450 -498
  145. package/dist/cjs/performance/ECSOptimization.js +644 -695
  146. package/dist/cjs/performance/GameSaveSystem.js +509 -556
  147. package/dist/cjs/performance/HotReload.js +447 -500
  148. package/dist/cjs/performance/InputRecording.js +511 -561
  149. package/dist/cjs/performance/InterestManagement.js +453 -500
  150. package/dist/cjs/performance/LocalizationRuntime.js +376 -423
  151. package/dist/cjs/performance/MemoryManagement.js +410 -470
  152. package/dist/cjs/performance/ModSupport.js +445 -496
  153. package/dist/cjs/performance/MultiThreadedPhysics.js +400 -443
  154. package/dist/cjs/performance/NetworkPrediction.js +424 -482
  155. package/dist/cjs/performance/ObjectPooling.js +569 -617
  156. package/dist/cjs/performance/Performance.js +174 -190
  157. package/dist/cjs/performance/PerformanceAdvanced.js +614 -637
  158. package/dist/cjs/performance/WebGPURenderer.js +656 -683
  159. package/dist/cjs/physics/PhysicsAdvanced.js +345 -379
  160. package/dist/cjs/physics/PhysicsEngine2D.js +391 -427
  161. package/dist/cjs/plugins/PluginSDK.js +432 -466
  162. package/dist/cjs/plugins/PluginTestKit.js +307 -330
  163. package/dist/cjs/procedural/Procedural.js +243 -254
  164. package/dist/cjs/procedural/WorldBuilding.js +297 -314
  165. package/dist/cjs/quest/QuestSystem.js +975 -932
  166. package/dist/cjs/release/MobileExport.js +157 -163
  167. package/dist/cjs/release/Release.js +225 -238
  168. package/dist/cjs/rendering/Camera2D.js +121 -124
  169. package/dist/cjs/rendering/Renderer2D.js +321 -335
  170. package/dist/cjs/rendering/WebGPURenderPipeline.js +632 -651
  171. package/dist/cjs/runtime3d/Runtime3D.js +359 -378
  172. package/dist/cjs/runtime3d/SceneEditor3D.js +252 -263
  173. package/dist/cjs/scene/SceneManager.js +177 -193
  174. package/dist/cjs/scripting/GraphToAST.js +574 -547
  175. package/dist/cjs/scripting/LanguageExporter.js +254 -279
  176. package/dist/cjs/scripting/NodeGraph.js +546 -570
  177. package/dist/cjs/scripting/ScriptAST.js +31 -39
  178. package/dist/cjs/scripting/VisualScripting2.js +1016 -1065
  179. package/dist/cjs/scripting/exporters/CSharpExporter.js +464 -496
  180. package/dist/cjs/scripting/exporters/GDScriptExporter.js +390 -442
  181. package/dist/cjs/scripting/exporters/LuaExporter.js +406 -447
  182. package/dist/cjs/scripting/exporters/PythonExporter.js +484 -549
  183. package/dist/cjs/scripting/exporters/RustExporter.js +459 -512
  184. package/dist/cjs/scripting/exporters/TypeScriptExporter.js +505 -556
  185. package/dist/cjs/social/Social.js +72 -80
  186. package/dist/cjs/systems/LightingSystem.js +844 -931
  187. package/dist/cjs/systems/ParticleSystem2.js +1447 -1451
  188. package/dist/cjs/systems/PhysicsDebugSystem.js +1070 -1141
  189. package/dist/cjs/systems/TerrainSystem.js +985 -1098
  190. package/dist/cjs/templates/ActionTemplates.js +296 -309
  191. package/dist/cjs/templates/FightingTemplate.js +417 -463
  192. package/dist/cjs/templates/MetroidvaniaTemplate.js +353 -405
  193. package/dist/cjs/templates/PartyTemplates.js +190 -202
  194. package/dist/cjs/templates/PuzzleTemplates.js +245 -261
  195. package/dist/cjs/templates/RPGTemplates.js +160 -178
  196. package/dist/cjs/templates/SportsTemplates.js +237 -250
  197. package/dist/cjs/templates/StrategyTemplates.js +143 -153
  198. package/dist/cjs/templates/SurvivalTemplate.js +336 -380
  199. package/dist/cjs/templates/WaveDefense.js +499 -526
  200. package/dist/cjs/tilemap/Tilemap.js +207 -214
  201. package/dist/cjs/tutorials/TutorialBranching.js +396 -417
  202. package/dist/cjs/tutorials/TutorialEngine.js +888 -931
  203. package/dist/cjs/tutorials/TutorialOverlay.js +602 -640
  204. package/dist/cjs/tutorials/content/Tutorials_T05_T08.js +787 -809
  205. package/dist/cjs/tutorials/content/Tutorials_T09_T11.js +736 -756
  206. package/dist/cjs/tutorials/content/Tutorials_T12_T15.js +754 -778
  207. package/dist/cjs/ui/GameUI.js +295 -312
  208. package/dist/cjs/unity-integration/UnityAssetStore.js +700 -741
  209. package/dist/cjs/unity-integration/UnityImport.js +1066 -1176
  210. package/dist/cjs/unity-integration/UnityLiveLink.js +934 -981
  211. package/dist/cjs/unity-integration/components/UnityAssetStoreBrowser.js +1233 -757
  212. package/dist/cjs/unity-integration/components/UnityProjectBrowser.js +1240 -768
  213. package/dist/cjs/unreal-integration/UnrealImport.js +391 -412
  214. package/dist/cjs/unreal-integration/UnrealLiveLink.js +1102 -1137
  215. package/dist/cjs/unreal-integration/UnrealMarketplace.js +436 -473
  216. package/dist/cjs/unreal-integration/components/UnrealProjectBrowser.js +1150 -767
  217. package/dist/cjs/xr/ARVR.js +167 -175
  218. package/dist/esm/accessibility/Accessibility.js +160 -164
  219. package/dist/esm/ai/AI.js +310 -293
  220. package/dist/esm/ai/BehaviorTree.js +1057 -1112
  221. package/dist/esm/ai/StateMachine.js +709 -755
  222. package/dist/esm/animation/Animation.js +237 -240
  223. package/dist/esm/audio/AudioAdvanced.js +239 -235
  224. package/dist/esm/audio/AudioBridge.js +448 -434
  225. package/dist/esm/audio/AudioManager.js +243 -258
  226. package/dist/esm/build-cloud/BuildOrchestration.js +1071 -1097
  227. package/dist/esm/build-cloud/GodotBuildCloud.js +647 -669
  228. package/dist/esm/build-cloud/UnityBuildCloud.js +571 -609
  229. package/dist/esm/build-cloud/UnrealBuildCloud.js +615 -634
  230. package/dist/esm/core/EventBus.js +52 -55
  231. package/dist/esm/core/GameClock.js +63 -65
  232. package/dist/esm/core/GameConfig.js +77 -78
  233. package/dist/esm/core/GameLoop.js +81 -88
  234. package/dist/esm/core/ServiceLocator.js +63 -64
  235. package/dist/esm/core/Validation.js +82 -81
  236. package/dist/esm/core/math.js +109 -111
  237. package/dist/esm/devtools/DevTools.js +546 -562
  238. package/dist/esm/devtools/DeveloperExperience.js +535 -558
  239. package/dist/esm/devtools/GameplayAnalytics.js +647 -645
  240. package/dist/esm/dialogue/DialogueSystem.js +998 -985
  241. package/dist/esm/docs/DocGenerator.js +342 -363
  242. package/dist/esm/ecs/World.js +358 -370
  243. package/dist/esm/editor/AchievementEditor.js +584 -635
  244. package/dist/esm/editor/AdvancedEditor.js +191 -190
  245. package/dist/esm/editor/AnimationRetargeting.js +700 -740
  246. package/dist/esm/editor/AssetBrowser.js +1078 -1159
  247. package/dist/esm/editor/AssetManager.js +188 -191
  248. package/dist/esm/editor/ConsolePro.js +977 -1060
  249. package/dist/esm/editor/CraftingEditor.js +684 -729
  250. package/dist/esm/editor/DebugTools.js +194 -184
  251. package/dist/esm/editor/DialogueSystem.js +849 -900
  252. package/dist/esm/editor/LeaderboardSystem.js +433 -482
  253. package/dist/esm/editor/NiceGameEditor.js +1908 -1200
  254. package/dist/esm/editor/PrefabSystem.js +777 -837
  255. package/dist/esm/editor/ProfilerPanel.js +654 -699
  256. package/dist/esm/editor/QuestEditor.js +795 -838
  257. package/dist/esm/editor/ReplaySystem.js +591 -633
  258. package/dist/esm/editor/SceneEditor.js +189 -199
  259. package/dist/esm/editor/ScreenshotMode.js +628 -687
  260. package/dist/esm/editor/ShaderGraph.js +1565 -1581
  261. package/dist/esm/editor/TimelineEditor.js +733 -777
  262. package/dist/esm/editor/UndoRedoPro.js +835 -903
  263. package/dist/esm/editor/VRARMode.js +586 -644
  264. package/dist/esm/engine/NiceGameEngine.js +142 -163
  265. package/dist/esm/engine/SaveSystem.js +447 -494
  266. package/dist/esm/enterprise/Enterprise.js +265 -260
  267. package/dist/esm/export/BevyExporter.js +929 -966
  268. package/dist/esm/export/CocosExporter.js +646 -672
  269. package/dist/esm/export/Construct3Exporter.js +785 -793
  270. package/dist/esm/export/DefoldExporter.js +1030 -1068
  271. package/dist/esm/export/GDevelopExporter.js +676 -707
  272. package/dist/esm/export/GameMakerExporter.js +793 -804
  273. package/dist/esm/export/GodotExporter.js +1004 -1044
  274. package/dist/esm/export/MinecraftBedrockExporter.js +575 -577
  275. package/dist/esm/export/MonoGameExporter.js +1267 -1292
  276. package/dist/esm/export/Pico8Exporter.js +768 -811
  277. package/dist/esm/export/PlatformExporter.js +193 -205
  278. package/dist/esm/export/RPGMakerExporter.js +862 -878
  279. package/dist/esm/export/RobloxExporter.js +885 -918
  280. package/dist/esm/export/Solar2DExporter.js +1220 -1255
  281. package/dist/esm/export/ThreeJSExporter.js +1007 -1072
  282. package/dist/esm/export/Tic80Exporter.js +1212 -1266
  283. package/dist/esm/export/UnityExporter.js +1117 -1130
  284. package/dist/esm/export/UnrealExporter.js +891 -918
  285. package/dist/esm/export/WebExporter.js +933 -969
  286. package/dist/esm/export/index.js +86 -71
  287. package/dist/esm/godot-integration/GodotAssetLibrary.js +663 -691
  288. package/dist/esm/godot-integration/GodotImport.js +935 -1026
  289. package/dist/esm/godot-integration/GodotLiveLink.js +918 -944
  290. package/dist/esm/godot-integration/components/GodotProjectBrowser.js +912 -610
  291. package/dist/esm/i18n/I18n.js +871 -899
  292. package/dist/esm/i18n/useTranslation.js +88 -88
  293. package/dist/esm/import/AsepriteImporter.js +637 -715
  294. package/dist/esm/import/DragonBonesImporter.js +417 -460
  295. package/dist/esm/import/GameMakerImporter.js +491 -520
  296. package/dist/esm/import/GodotSceneImporter.js +767 -821
  297. package/dist/esm/import/LDtkImporter.js +415 -453
  298. package/dist/esm/import/Live2DImporter.js +477 -517
  299. package/dist/esm/import/NdgFormat.js +410 -456
  300. package/dist/esm/import/OgmoImporter.js +446 -492
  301. package/dist/esm/import/RPGMakerImporter.js +431 -476
  302. package/dist/esm/import/SceneImporter.js +385 -422
  303. package/dist/esm/import/SpineImporter.js +491 -545
  304. package/dist/esm/import/SpriterImporter.js +570 -612
  305. package/dist/esm/import/TiledMapImporter.js +790 -845
  306. package/dist/esm/import/UnitySceneImporter.js +666 -702
  307. package/dist/esm/import/index.js +247 -258
  308. package/dist/esm/index.js +1332 -188
  309. package/dist/esm/input/GamepadNavigation.js +187 -204
  310. package/dist/esm/input/InputManager.js +401 -420
  311. package/dist/esm/input/useGamepads.js +72 -80
  312. package/dist/esm/integration/IconSprite.js +143 -255
  313. package/dist/esm/inventory/InventorySystem.js +925 -994
  314. package/dist/esm/kids/KidMode.js +1003 -1021
  315. package/dist/esm/kids/KidTools.js +573 -593
  316. package/dist/esm/monetization/Monetization.js +180 -176
  317. package/dist/esm/multiplayer/LocalMultiplayer.js +290 -286
  318. package/dist/esm/multiplayer/MiniGameTypes.js +58 -58
  319. package/dist/esm/native-engine/AnimationSystem.js +735 -805
  320. package/dist/esm/native-engine/AssetPipeline.js +456 -514
  321. package/dist/esm/native-engine/AudioEngine.js +765 -803
  322. package/dist/esm/native-engine/InputSystem.js +1079 -1144
  323. package/dist/esm/native-engine/NetworkingSystem.js +740 -792
  324. package/dist/esm/native-engine/PhysicsEngine.js +585 -606
  325. package/dist/esm/native-engine/RenderingEngine.js +304 -349
  326. package/dist/esm/native-engine/SceneGraph.js +773 -807
  327. package/dist/esm/network/MultiplayerTransport.js +99 -131
  328. package/dist/esm/network/Networking.js +556 -563
  329. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/AbortController.js +22 -28
  330. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/AccessTokenHttpClient.js +41 -47
  331. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/DefaultHttpClient.js +36 -42
  332. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/DefaultReconnectPolicy.js +11 -14
  333. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/Errors.js +111 -134
  334. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/FetchHttpClient.js +132 -157
  335. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HandshakeProtocol.js +40 -52
  336. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HeaderNames.js +6 -7
  337. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HttpClient.js +42 -47
  338. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HttpConnection.js +496 -571
  339. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HubConnection.js +828 -952
  340. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HubConnectionBuilder.js +126 -145
  341. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/IHubProtocol.js +14 -23
  342. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/ILogger.js +12 -25
  343. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/ITransport.js +15 -24
  344. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/JsonHubProtocol.js +109 -120
  345. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/Loggers.js +11 -13
  346. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/LongPollingTransport.js +151 -184
  347. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/MessageBuffer.js +159 -195
  348. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/ServerSentEventsTransport.js +91 -104
  349. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/Subject.js +31 -34
  350. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/TextMessageFormat.js +17 -20
  351. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/Utils.js +230 -248
  352. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/WebSocketTransport.js +136 -156
  353. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/XhrHttpClient.js +77 -84
  354. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/index.js +31 -12
  355. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/pkg-version.js +4 -3
  356. package/dist/esm/pathfinding/Pathfinding.js +249 -262
  357. package/dist/esm/performance/AssetStreaming.js +567 -634
  358. package/dist/esm/performance/BenchmarkSuite.js +285 -310
  359. package/dist/esm/performance/DeltaCompression.js +478 -525
  360. package/dist/esm/performance/DeterministicPhysics.js +479 -497
  361. package/dist/esm/performance/ECSOptimization.js +653 -694
  362. package/dist/esm/performance/GameSaveSystem.js +515 -555
  363. package/dist/esm/performance/HotReload.js +454 -499
  364. package/dist/esm/performance/InputRecording.js +520 -560
  365. package/dist/esm/performance/InterestManagement.js +460 -499
  366. package/dist/esm/performance/LocalizationRuntime.js +382 -422
  367. package/dist/esm/performance/MemoryManagement.js +415 -469
  368. package/dist/esm/performance/ModSupport.js +455 -495
  369. package/dist/esm/performance/MultiThreadedPhysics.js +408 -442
  370. package/dist/esm/performance/NetworkPrediction.js +436 -481
  371. package/dist/esm/performance/ObjectPooling.js +582 -616
  372. package/dist/esm/performance/Performance.js +182 -189
  373. package/dist/esm/performance/PerformanceAdvanced.js +621 -636
  374. package/dist/esm/performance/WebGPURenderer.js +660 -682
  375. package/dist/esm/physics/PhysicsAdvanced.js +359 -378
  376. package/dist/esm/physics/PhysicsEngine2D.js +393 -426
  377. package/dist/esm/plugins/PluginSDK.js +435 -465
  378. package/dist/esm/plugins/PluginTestKit.js +315 -329
  379. package/dist/esm/procedural/Procedural.js +248 -253
  380. package/dist/esm/procedural/WorldBuilding.js +316 -313
  381. package/dist/esm/quest/QuestSystem.js +982 -931
  382. package/dist/esm/release/MobileExport.js +163 -162
  383. package/dist/esm/release/Release.js +234 -237
  384. package/dist/esm/rendering/Camera2D.js +122 -123
  385. package/dist/esm/rendering/Renderer2D.js +323 -334
  386. package/dist/esm/rendering/WebGPURenderPipeline.js +647 -650
  387. package/dist/esm/runtime3d/Runtime3D.js +368 -377
  388. package/dist/esm/runtime3d/SceneEditor3D.js +268 -262
  389. package/dist/esm/scene/SceneManager.js +178 -192
  390. package/dist/esm/scripting/GraphToAST.js +576 -546
  391. package/dist/esm/scripting/LanguageExporter.js +263 -278
  392. package/dist/esm/scripting/NodeGraph.js +550 -569
  393. package/dist/esm/scripting/ScriptAST.js +45 -38
  394. package/dist/esm/scripting/VisualScripting2.js +1025 -1064
  395. package/dist/esm/scripting/exporters/CSharpExporter.js +465 -495
  396. package/dist/esm/scripting/exporters/GDScriptExporter.js +391 -441
  397. package/dist/esm/scripting/exporters/LuaExporter.js +407 -446
  398. package/dist/esm/scripting/exporters/PythonExporter.js +485 -548
  399. package/dist/esm/scripting/exporters/RustExporter.js +460 -511
  400. package/dist/esm/scripting/exporters/TypeScriptExporter.js +506 -555
  401. package/dist/esm/social/Social.js +77 -79
  402. package/dist/esm/systems/LightingSystem.js +855 -930
  403. package/dist/esm/systems/ParticleSystem2.js +1453 -1450
  404. package/dist/esm/systems/PhysicsDebugSystem.js +1078 -1140
  405. package/dist/esm/systems/TerrainSystem.js +996 -1097
  406. package/dist/esm/templates/ActionTemplates.js +307 -308
  407. package/dist/esm/templates/FightingTemplate.js +439 -462
  408. package/dist/esm/templates/MetroidvaniaTemplate.js +391 -404
  409. package/dist/esm/templates/PartyTemplates.js +206 -201
  410. package/dist/esm/templates/PuzzleTemplates.js +260 -260
  411. package/dist/esm/templates/RPGTemplates.js +172 -177
  412. package/dist/esm/templates/SportsTemplates.js +251 -249
  413. package/dist/esm/templates/StrategyTemplates.js +158 -152
  414. package/dist/esm/templates/SurvivalTemplate.js +367 -379
  415. package/dist/esm/templates/WaveDefense.js +501 -525
  416. package/dist/esm/tilemap/Tilemap.js +209 -213
  417. package/dist/esm/tutorials/TutorialBranching.js +399 -416
  418. package/dist/esm/tutorials/TutorialEngine.js +893 -930
  419. package/dist/esm/tutorials/TutorialOverlay.js +603 -639
  420. package/dist/esm/tutorials/content/Tutorials_T05_T08.js +792 -808
  421. package/dist/esm/tutorials/content/Tutorials_T09_T11.js +740 -755
  422. package/dist/esm/tutorials/content/Tutorials_T12_T15.js +759 -777
  423. package/dist/esm/ui/GameUI.js +296 -311
  424. package/dist/esm/unity-integration/UnityAssetStore.js +704 -740
  425. package/dist/esm/unity-integration/UnityImport.js +1071 -1175
  426. package/dist/esm/unity-integration/UnityLiveLink.js +938 -980
  427. package/dist/esm/unity-integration/components/UnityAssetStoreBrowser.js +1234 -756
  428. package/dist/esm/unity-integration/components/UnityProjectBrowser.js +1241 -767
  429. package/dist/esm/unreal-integration/UnrealImport.js +395 -411
  430. package/dist/esm/unreal-integration/UnrealLiveLink.js +1105 -1136
  431. package/dist/esm/unreal-integration/UnrealMarketplace.js +442 -472
  432. package/dist/esm/unreal-integration/components/UnrealProjectBrowser.js +1151 -766
  433. package/dist/esm/xr/ARVR.js +181 -174
  434. package/package.json +7 -12
@@ -1,494 +1,470 @@
1
- 'use strict';
2
-
3
- var SceneImporter = require('./SceneImporter.js');
4
-
5
- /**
6
- * @file DragonBonesImporter.ts
7
- * @description DragonBones Skeletal Animation Importer
8
- * PRO-1.3: Scene Format Interoperability
9
- *
10
- * DragonBones is a free, open-source 2D skeletal animation tool.
11
- *
12
- * File Types:
13
- * - *_ske.json - Skeleton data
14
- * - *_tex.json - Texture atlas data
15
- * - *_tex.png - Texture image
16
- */
17
- // ============================================================
18
- // DragonBones Importer
19
- // ============================================================
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
25
+ const SceneImporter = require("./SceneImporter.js");
20
26
  class DragonBonesImporter extends SceneImporter.SceneImporter {
21
- constructor() {
22
- super('dragonbones');
23
- this.textureAtlas = null;
24
- }
25
- canHandle(filePath) {
26
- const name = filePath.toLowerCase();
27
- return name.endsWith('_ske.json') || name.endsWith('_tex.json') || name.endsWith('.dbbin');
28
- }
29
- async import(options) {
30
- const startTime = Date.now();
31
- this.options = options;
32
- this.clearMessages();
33
- const scenes = [];
34
- const assets = [];
35
- try {
36
- const fileName = options.sourcePath.toLowerCase();
37
- const content = await this.readFile(options.sourcePath);
38
- if (fileName.endsWith('_tex.json')) {
39
- // Parse texture atlas
40
- this.textureAtlas = JSON.parse(content);
41
- // Create texture asset
42
- assets.push({
27
+ constructor() {
28
+ super("dragonbones");
29
+ this.textureAtlas = null;
30
+ }
31
+ canHandle(filePath) {
32
+ const name = filePath.toLowerCase();
33
+ return name.endsWith("_ske.json") || name.endsWith("_tex.json") || name.endsWith(".dbbin");
34
+ }
35
+ async import(options) {
36
+ const startTime = Date.now();
37
+ this.options = options;
38
+ this.clearMessages();
39
+ const scenes = [];
40
+ const assets = [];
41
+ try {
42
+ const fileName = options.sourcePath.toLowerCase();
43
+ const content = await this.readFile(options.sourcePath);
44
+ if (fileName.endsWith("_tex.json")) {
45
+ this.textureAtlas = JSON.parse(content);
46
+ assets.push({
47
+ id: this.generateId(),
48
+ name: this.textureAtlas.name,
49
+ type: "texture",
50
+ path: this.textureAtlas.imagePath,
51
+ data: {
52
+ width: this.textureAtlas.width,
53
+ height: this.textureAtlas.height
54
+ }
55
+ });
56
+ for (const subTex of this.textureAtlas.SubTexture) {
57
+ assets.push({
58
+ id: this.generateId(),
59
+ name: subTex.name,
60
+ type: "texture",
61
+ path: this.textureAtlas.imagePath,
62
+ data: {
63
+ frame: { x: subTex.x, y: subTex.y, width: subTex.width, height: subTex.height },
64
+ sourceSize: subTex.frameWidth && subTex.frameHeight ? { width: subTex.frameWidth, height: subTex.frameHeight } : void 0,
65
+ offset: subTex.frameX !== void 0 ? { x: subTex.frameX, y: subTex.frameY || 0 } : void 0
66
+ }
67
+ });
68
+ }
69
+ } else if (fileName.endsWith("_ske.json")) {
70
+ const skeleton = JSON.parse(content);
71
+ if (options.resolveDependencies) {
72
+ const texPath = options.sourcePath.replace("_ske.json", "_tex.json");
73
+ try {
74
+ const texContent = await this.readFile(texPath);
75
+ this.textureAtlas = JSON.parse(texContent);
76
+ } catch {
77
+ this.addWarning("TEX_NOT_FOUND", "Texture atlas not found", texPath);
78
+ }
79
+ }
80
+ for (const armature of skeleton.armature) {
81
+ const scene = this.convertArmatureToScene(armature, skeleton);
82
+ scenes.push(scene);
83
+ for (const skin of armature.skin) {
84
+ for (const slot of skin.slot) {
85
+ for (const display of slot.display) {
86
+ if (display.type === "image" || !display.type) {
87
+ const imageDisplay = display;
88
+ assets.push({
43
89
  id: this.generateId(),
44
- name: this.textureAtlas.name,
45
- type: 'texture',
46
- path: this.textureAtlas.imagePath,
90
+ name: imageDisplay.path || imageDisplay.name,
91
+ type: "texture",
92
+ path: imageDisplay.path || imageDisplay.name,
47
93
  data: {
48
- width: this.textureAtlas.width,
49
- height: this.textureAtlas.height,
50
- },
51
- });
52
- // Create subtexture assets
53
- for (const subTex of this.textureAtlas.SubTexture) {
54
- assets.push({
55
- id: this.generateId(),
56
- name: subTex.name,
57
- type: 'texture',
58
- path: this.textureAtlas.imagePath,
59
- data: {
60
- frame: { x: subTex.x, y: subTex.y, width: subTex.width, height: subTex.height },
61
- sourceSize: subTex.frameWidth && subTex.frameHeight
62
- ? { width: subTex.frameWidth, height: subTex.frameHeight }
63
- : undefined,
64
- offset: subTex.frameX !== undefined
65
- ? { x: subTex.frameX, y: subTex.frameY || 0 }
66
- : undefined,
67
- },
68
- });
69
- }
70
- }
71
- else if (fileName.endsWith('_ske.json')) {
72
- // Parse skeleton data
73
- const skeleton = JSON.parse(content);
74
- // Try to load texture atlas
75
- if (options.resolveDependencies) {
76
- const texPath = options.sourcePath.replace('_ske.json', '_tex.json');
77
- try {
78
- const texContent = await this.readFile(texPath);
79
- this.textureAtlas = JSON.parse(texContent);
80
- }
81
- catch {
82
- this.addWarning('TEX_NOT_FOUND', 'Texture atlas not found', texPath);
83
- }
84
- }
85
- // Convert each armature to a scene
86
- for (const armature of skeleton.armature) {
87
- const scene = this.convertArmatureToScene(armature, skeleton);
88
- scenes.push(scene);
89
- // Extract display assets
90
- for (const skin of armature.skin) {
91
- for (const slot of skin.slot) {
92
- for (const display of slot.display) {
93
- if (display.type === 'image' || !display.type) {
94
- const imageDisplay = display;
95
- assets.push({
96
- id: this.generateId(),
97
- name: imageDisplay.path || imageDisplay.name,
98
- type: 'texture',
99
- path: imageDisplay.path || imageDisplay.name,
100
- data: {
101
- pivot: imageDisplay.pivot,
102
- },
103
- });
104
- }
105
- }
106
- }
94
+ pivot: imageDisplay.pivot
107
95
  }
96
+ });
108
97
  }
98
+ }
109
99
  }
100
+ }
110
101
  }
111
- catch (error) {
112
- this.addError('IMPORT_ERROR', `Failed to import: ${error}`, options.sourcePath, undefined, true);
113
- }
114
- return this.createResult(scenes, assets, startTime);
102
+ }
103
+ } catch (error) {
104
+ this.addError(
105
+ "IMPORT_ERROR",
106
+ `Failed to import: ${error}`,
107
+ options.sourcePath,
108
+ void 0,
109
+ true
110
+ );
115
111
  }
116
- async parseFile(content, filePath) {
117
- const stringContent = typeof content === 'string' ? content : new TextDecoder().decode(content);
118
- try {
119
- if (filePath.toLowerCase().endsWith('_tex.json')) {
120
- return null; // Texture files don't produce scenes
121
- }
122
- const skeleton = JSON.parse(stringContent);
123
- if (skeleton.armature && skeleton.armature.length > 0) {
124
- return this.convertArmatureToParsed(skeleton.armature[0], skeleton);
125
- }
126
- }
127
- catch {
128
- return null;
129
- }
112
+ return this.createResult(scenes, assets, startTime);
113
+ }
114
+ async parseFile(content, filePath) {
115
+ const stringContent = typeof content === "string" ? content : new TextDecoder().decode(content);
116
+ try {
117
+ if (filePath.toLowerCase().endsWith("_tex.json")) {
130
118
  return null;
119
+ }
120
+ const skeleton = JSON.parse(stringContent);
121
+ if (skeleton.armature && skeleton.armature.length > 0) {
122
+ return this.convertArmatureToParsed(skeleton.armature[0], skeleton);
123
+ }
124
+ } catch {
125
+ return null;
131
126
  }
132
- async validate(sourcePath) {
133
- const errors = [];
134
- if (!this.canHandle(sourcePath)) {
135
- errors.push({
136
- code: 'INVALID_FORMAT',
137
- message: `File ${sourcePath} is not a valid DragonBones file`,
138
- file: sourcePath,
139
- fatal: true,
140
- });
141
- }
142
- return errors;
127
+ return null;
128
+ }
129
+ async validate(sourcePath) {
130
+ const errors = [];
131
+ if (!this.canHandle(sourcePath)) {
132
+ errors.push({
133
+ code: "INVALID_FORMAT",
134
+ message: `File ${sourcePath} is not a valid DragonBones file`,
135
+ file: sourcePath,
136
+ fatal: true
137
+ });
143
138
  }
144
- // ----------------------------------------
145
- // Armature Conversion
146
- // ----------------------------------------
147
- convertArmatureToScene(armature, skeleton) {
148
- const entities = [];
149
- // Create root entity
150
- const rootEntity = {
151
- id: this.generateId(),
152
- name: armature.name,
153
- components: [
154
- {
155
- type: 'Transform',
156
- data: {
157
- position: { x: 0, y: 0 },
158
- rotation: 0,
159
- scale: { x: 1, y: 1 },
160
- },
161
- },
162
- {
163
- type: 'DragonBonesArmature',
164
- data: {
165
- version: skeleton.version,
166
- frameRate: armature.frameRate || skeleton.frameRate,
167
- aabb: armature.aabb,
168
- skins: armature.skin.map((s) => s.name),
169
- animations: armature.animation.map((a) => a.name),
170
- },
171
- },
172
- ],
173
- children: [],
174
- tags: ['dragonbones', 'armature'],
175
- active: true,
176
- };
177
- // Create bone hierarchy
178
- rootEntity.children = this.createBoneHierarchy(armature.bone);
179
- // Add slots
180
- for (const slot of armature.slot) {
181
- this.addSlotToEntity(rootEntity, slot, armature);
139
+ return errors;
140
+ }
141
+ // ----------------------------------------
142
+ // Armature Conversion
143
+ // ----------------------------------------
144
+ convertArmatureToScene(armature, skeleton) {
145
+ const entities = [];
146
+ const rootEntity = {
147
+ id: this.generateId(),
148
+ name: armature.name,
149
+ components: [
150
+ {
151
+ type: "Transform",
152
+ data: {
153
+ position: { x: 0, y: 0 },
154
+ rotation: 0,
155
+ scale: { x: 1, y: 1 }
156
+ }
157
+ },
158
+ {
159
+ type: "DragonBonesArmature",
160
+ data: {
161
+ version: skeleton.version,
162
+ frameRate: armature.frameRate || skeleton.frameRate,
163
+ aabb: armature.aabb,
164
+ skins: armature.skin.map((s) => s.name),
165
+ animations: armature.animation.map((a) => a.name)
166
+ }
182
167
  }
183
- // Add IK constraints
184
- if (armature.ik) {
185
- for (const ik of armature.ik) {
186
- rootEntity.components.push({
187
- type: 'IKConstraint',
188
- data: {
189
- name: ik.name,
190
- bone: ik.bone,
191
- target: ik.target,
192
- chain: ik.chain ?? 0,
193
- bendPositive: ik.bendPositive ?? true,
194
- weight: ik.weight ?? 1,
195
- },
196
- });
197
- }
198
- }
199
- // Add animations
200
- for (const anim of armature.animation) {
201
- rootEntity.components.push({
202
- type: 'Animation',
203
- data: this.convertAnimation(anim, armature.frameRate || skeleton.frameRate),
204
- });
205
- }
206
- entities.push(rootEntity);
207
- return {
208
- id: this.generateId(),
209
- name: armature.name,
210
- entities,
211
- settings: {
212
- width: armature.aabb.width,
213
- height: armature.aabb.height,
214
- backgroundColor: '#1a1a2e',
215
- frameRate: armature.frameRate || skeleton.frameRate,
216
- },
217
- };
168
+ ],
169
+ children: [],
170
+ tags: ["dragonbones", "armature"],
171
+ active: true
172
+ };
173
+ rootEntity.children = this.createBoneHierarchy(armature.bone);
174
+ for (const slot of armature.slot) {
175
+ this.addSlotToEntity(rootEntity, slot, armature);
176
+ }
177
+ if (armature.ik) {
178
+ for (const ik of armature.ik) {
179
+ rootEntity.components.push({
180
+ type: "IKConstraint",
181
+ data: {
182
+ name: ik.name,
183
+ bone: ik.bone,
184
+ target: ik.target,
185
+ chain: ik.chain ?? 0,
186
+ bendPositive: ik.bendPositive ?? true,
187
+ weight: ik.weight ?? 1
188
+ }
189
+ });
190
+ }
218
191
  }
219
- convertArmatureToParsed(armature, skeleton) {
220
- const entities = [];
221
- // Create bone entities
222
- for (const bone of armature.bone) {
223
- entities.push({
224
- id: bone.name,
225
- name: bone.name,
226
- type: 'Bone',
227
- x: bone.transform?.x || 0,
228
- y: bone.transform?.y || 0,
229
- width: bone.length || 0,
230
- height: 4,
231
- rotation: bone.transform?.skX || 0,
232
- scaleX: bone.transform?.scX ?? 1,
233
- scaleY: bone.transform?.scY ?? 1,
234
- visible: true,
235
- components: [],
236
- children: [],
237
- properties: {
238
- parent: bone.parent,
239
- length: bone.length,
240
- skewY: bone.transform?.skY,
241
- },
242
- });
192
+ for (const anim of armature.animation) {
193
+ rootEntity.components.push({
194
+ type: "Animation",
195
+ data: this.convertAnimation(anim, armature.frameRate || skeleton.frameRate)
196
+ });
197
+ }
198
+ entities.push(rootEntity);
199
+ return {
200
+ id: this.generateId(),
201
+ name: armature.name,
202
+ entities,
203
+ settings: {
204
+ width: armature.aabb.width,
205
+ height: armature.aabb.height,
206
+ backgroundColor: "#1a1a2e",
207
+ frameRate: armature.frameRate || skeleton.frameRate
208
+ }
209
+ };
210
+ }
211
+ convertArmatureToParsed(armature, skeleton) {
212
+ const entities = [];
213
+ for (const bone of armature.bone) {
214
+ entities.push({
215
+ id: bone.name,
216
+ name: bone.name,
217
+ type: "Bone",
218
+ x: bone.transform?.x || 0,
219
+ y: bone.transform?.y || 0,
220
+ width: bone.length || 0,
221
+ height: 4,
222
+ rotation: bone.transform?.skX || 0,
223
+ scaleX: bone.transform?.scX ?? 1,
224
+ scaleY: bone.transform?.scY ?? 1,
225
+ visible: true,
226
+ components: [],
227
+ children: [],
228
+ properties: {
229
+ parent: bone.parent,
230
+ length: bone.length,
231
+ skewY: bone.transform?.skY
243
232
  }
244
- // Create slot entities
245
- for (const slot of armature.slot) {
246
- entities.push({
247
- id: slot.name,
248
- name: slot.name,
249
- type: 'Slot',
250
- x: 0,
251
- y: 0,
252
- width: 32,
253
- height: 32,
254
- rotation: 0,
255
- scaleX: 1,
256
- scaleY: 1,
257
- visible: true,
258
- components: [],
259
- children: [],
260
- properties: {
261
- bone: slot.parent,
262
- displayIndex: slot.displayIndex,
263
- blendMode: slot.blendMode,
264
- color: slot.color,
265
- },
266
- });
233
+ });
234
+ }
235
+ for (const slot of armature.slot) {
236
+ entities.push({
237
+ id: slot.name,
238
+ name: slot.name,
239
+ type: "Slot",
240
+ x: 0,
241
+ y: 0,
242
+ width: 32,
243
+ height: 32,
244
+ rotation: 0,
245
+ scaleX: 1,
246
+ scaleY: 1,
247
+ visible: true,
248
+ components: [],
249
+ children: [],
250
+ properties: {
251
+ bone: slot.parent,
252
+ displayIndex: slot.displayIndex,
253
+ blendMode: slot.blendMode,
254
+ color: slot.color
267
255
  }
268
- return {
269
- name: armature.name,
270
- width: armature.aabb.width,
271
- height: armature.aabb.height,
272
- backgroundColor: '#1a1a2e',
273
- layers: [
274
- {
275
- name: 'Armature',
276
- type: 'object',
277
- visible: true,
278
- opacity: 1,
279
- offsetX: 0,
280
- offsetY: 0,
281
- zIndex: 0,
282
- properties: {},
283
- },
284
- ],
285
- entities,
286
- properties: {
287
- version: skeleton.version,
288
- frameRate: armature.frameRate || skeleton.frameRate,
289
- animations: armature.animation.map((a) => a.name),
290
- skins: armature.skin.map((s) => s.name),
291
- },
292
- };
256
+ });
293
257
  }
294
- // ----------------------------------------
295
- // Bone Hierarchy
296
- // ----------------------------------------
297
- createBoneHierarchy(bones) {
298
- const boneMap = new Map();
299
- const rootBones = [];
300
- // Create all bone entities first
301
- for (const bone of bones) {
302
- const transform = bone.transform || {};
303
- const entity = {
304
- id: bone.name,
305
- name: bone.name,
306
- components: [
307
- {
308
- type: 'Transform',
309
- data: {
310
- position: { x: transform.x || 0, y: transform.y || 0 },
311
- rotation: transform.skX || 0,
312
- scale: { x: transform.scX ?? 1, y: transform.scY ?? 1 },
313
- },
314
- },
315
- {
316
- type: 'Bone',
317
- data: {
318
- length: bone.length || 0,
319
- skewY: transform.skY || 0,
320
- inheritTranslation: bone.inheritTranslation ?? true,
321
- inheritRotation: bone.inheritRotation ?? true,
322
- inheritScale: bone.inheritScale ?? true,
323
- },
324
- },
325
- ],
326
- children: [],
327
- tags: ['bone'],
328
- active: true,
329
- };
330
- boneMap.set(bone.name, entity);
258
+ return {
259
+ name: armature.name,
260
+ width: armature.aabb.width,
261
+ height: armature.aabb.height,
262
+ backgroundColor: "#1a1a2e",
263
+ layers: [
264
+ {
265
+ name: "Armature",
266
+ type: "object",
267
+ visible: true,
268
+ opacity: 1,
269
+ offsetX: 0,
270
+ offsetY: 0,
271
+ zIndex: 0,
272
+ properties: {}
331
273
  }
332
- // Build hierarchy
333
- for (const bone of bones) {
334
- const entity = boneMap.get(bone.name);
335
- if (bone.parent) {
336
- const parent = boneMap.get(bone.parent);
337
- if (parent) {
338
- if (!parent.children) {
339
- parent.children = [];
340
- }
341
- parent.children.push(entity);
342
- }
343
- else {
344
- rootBones.push(entity);
345
- }
274
+ ],
275
+ entities,
276
+ properties: {
277
+ version: skeleton.version,
278
+ frameRate: armature.frameRate || skeleton.frameRate,
279
+ animations: armature.animation.map((a) => a.name),
280
+ skins: armature.skin.map((s) => s.name)
281
+ }
282
+ };
283
+ }
284
+ // ----------------------------------------
285
+ // Bone Hierarchy
286
+ // ----------------------------------------
287
+ createBoneHierarchy(bones) {
288
+ const boneMap = /* @__PURE__ */ new Map();
289
+ const rootBones = [];
290
+ for (const bone of bones) {
291
+ const transform = bone.transform || {};
292
+ const entity = {
293
+ id: bone.name,
294
+ name: bone.name,
295
+ components: [
296
+ {
297
+ type: "Transform",
298
+ data: {
299
+ position: { x: transform.x || 0, y: transform.y || 0 },
300
+ rotation: transform.skX || 0,
301
+ scale: { x: transform.scX ?? 1, y: transform.scY ?? 1 }
346
302
  }
347
- else {
348
- rootBones.push(entity);
303
+ },
304
+ {
305
+ type: "Bone",
306
+ data: {
307
+ length: bone.length || 0,
308
+ skewY: transform.skY || 0,
309
+ inheritTranslation: bone.inheritTranslation ?? true,
310
+ inheritRotation: bone.inheritRotation ?? true,
311
+ inheritScale: bone.inheritScale ?? true
349
312
  }
350
- }
351
- return rootBones;
313
+ }
314
+ ],
315
+ children: [],
316
+ tags: ["bone"],
317
+ active: true
318
+ };
319
+ boneMap.set(bone.name, entity);
352
320
  }
353
- addSlotToEntity(rootEntity, slot, armature) {
354
- // Find the bone entity
355
- const boneEntity = this.findBoneEntity(rootEntity, slot.parent);
356
- if (!boneEntity) {
357
- return;
358
- }
359
- // Get display from default skin
360
- const defaultSkin = armature.skin.find((s) => s.name === 'default') || armature.skin[0];
361
- const skinSlot = defaultSkin?.slot.find((s) => s.name === slot.name);
362
- const defaultDisplay = skinSlot?.display[slot.displayIndex ?? 0];
363
- const slotData = {
364
- name: slot.name,
365
- bone: slot.parent,
366
- displayIndex: slot.displayIndex ?? 0,
367
- blendMode: slot.blendMode || 'normal',
368
- };
369
- if (slot.color) {
370
- slotData.color = this.convertColor(slot.color);
321
+ for (const bone of bones) {
322
+ const entity = boneMap.get(bone.name);
323
+ if (bone.parent) {
324
+ const parent = boneMap.get(bone.parent);
325
+ if (parent) {
326
+ if (!parent.children) {
327
+ parent.children = [];
328
+ }
329
+ parent.children.push(entity);
330
+ } else {
331
+ rootBones.push(entity);
371
332
  }
333
+ } else {
334
+ rootBones.push(entity);
335
+ }
336
+ }
337
+ return rootBones;
338
+ }
339
+ addSlotToEntity(rootEntity, slot, armature) {
340
+ const boneEntity = this.findBoneEntity(rootEntity, slot.parent);
341
+ if (!boneEntity) {
342
+ return;
343
+ }
344
+ const defaultSkin = armature.skin.find((s) => s.name === "default") || armature.skin[0];
345
+ const skinSlot = defaultSkin?.slot.find((s) => s.name === slot.name);
346
+ const defaultDisplay = skinSlot?.display[slot.displayIndex ?? 0];
347
+ const slotData = {
348
+ name: slot.name,
349
+ bone: slot.parent,
350
+ displayIndex: slot.displayIndex ?? 0,
351
+ blendMode: slot.blendMode || "normal"
352
+ };
353
+ if (slot.color) {
354
+ slotData.color = this.convertColor(slot.color);
355
+ }
356
+ boneEntity.components.push({
357
+ type: "Slot",
358
+ data: slotData
359
+ });
360
+ if (defaultDisplay) {
361
+ if (defaultDisplay.type === "mesh") {
362
+ const meshDisplay = defaultDisplay;
372
363
  boneEntity.components.push({
373
- type: 'Slot',
374
- data: slotData,
364
+ type: "Mesh",
365
+ data: {
366
+ name: meshDisplay.name,
367
+ path: meshDisplay.path,
368
+ vertices: meshDisplay.vertices,
369
+ uvs: meshDisplay.uvs,
370
+ triangles: meshDisplay.triangles,
371
+ weights: meshDisplay.weights,
372
+ transform: meshDisplay.transform
373
+ }
375
374
  });
376
- // Add display component
377
- if (defaultDisplay) {
378
- if (defaultDisplay.type === 'mesh') {
379
- const meshDisplay = defaultDisplay;
380
- boneEntity.components.push({
381
- type: 'Mesh',
382
- data: {
383
- name: meshDisplay.name,
384
- path: meshDisplay.path,
385
- vertices: meshDisplay.vertices,
386
- uvs: meshDisplay.uvs,
387
- triangles: meshDisplay.triangles,
388
- weights: meshDisplay.weights,
389
- transform: meshDisplay.transform,
390
- },
391
- });
392
- }
393
- else if (defaultDisplay.type === 'boundingBox') {
394
- const bbDisplay = defaultDisplay;
395
- boneEntity.components.push({
396
- type: 'BoundingBox',
397
- data: {
398
- name: bbDisplay.name,
399
- subType: bbDisplay.subType || 'rectangle',
400
- width: bbDisplay.width,
401
- height: bbDisplay.height,
402
- vertices: bbDisplay.vertices,
403
- },
404
- });
405
- }
406
- else {
407
- const imageDisplay = defaultDisplay;
408
- boneEntity.components.push({
409
- type: 'Sprite',
410
- data: {
411
- name: imageDisplay.name,
412
- path: imageDisplay.path || imageDisplay.name,
413
- pivot: imageDisplay.pivot,
414
- transform: imageDisplay.transform,
415
- },
416
- });
417
- }
418
- }
375
+ } else if (defaultDisplay.type === "boundingBox") {
376
+ const bbDisplay = defaultDisplay;
377
+ boneEntity.components.push({
378
+ type: "BoundingBox",
379
+ data: {
380
+ name: bbDisplay.name,
381
+ subType: bbDisplay.subType || "rectangle",
382
+ width: bbDisplay.width,
383
+ height: bbDisplay.height,
384
+ vertices: bbDisplay.vertices
385
+ }
386
+ });
387
+ } else {
388
+ const imageDisplay = defaultDisplay;
389
+ boneEntity.components.push({
390
+ type: "Sprite",
391
+ data: {
392
+ name: imageDisplay.name,
393
+ path: imageDisplay.path || imageDisplay.name,
394
+ pivot: imageDisplay.pivot,
395
+ transform: imageDisplay.transform
396
+ }
397
+ });
398
+ }
419
399
  }
420
- findBoneEntity(entity, boneName) {
421
- if (entity.name === boneName) {
422
- return entity;
423
- }
424
- for (const child of entity.children ?? []) {
425
- const found = this.findBoneEntity(child, boneName);
426
- if (found) {
427
- return found;
428
- }
429
- }
430
- return null;
400
+ }
401
+ findBoneEntity(entity, boneName) {
402
+ if (entity.name === boneName) {
403
+ return entity;
431
404
  }
432
- // ----------------------------------------
433
- // Animation Conversion
434
- // ----------------------------------------
435
- convertAnimation(anim, frameRate) {
436
- return {
437
- name: anim.name,
438
- duration: anim.duration / frameRate,
439
- frameRate,
440
- playTimes: anim.playTimes ?? 0,
441
- fadeInTime: anim.fadeInTime ?? 0,
442
- bones: anim.bone?.map((timeline) => ({
443
- name: timeline.name,
444
- translate: timeline.translateFrame,
445
- rotate: timeline.rotateFrame,
446
- scale: timeline.scaleFrame,
447
- legacy: timeline.frame,
448
- })),
449
- slots: anim.slot?.map((timeline) => ({
450
- name: timeline.name,
451
- display: timeline.displayFrame,
452
- color: timeline.colorFrame,
453
- legacy: timeline.frame,
454
- })),
455
- ffd: anim.ffd,
456
- ik: anim.ik,
457
- zOrder: anim.zOrder,
458
- events: anim.frame,
459
- };
405
+ for (const child of entity.children ?? []) {
406
+ const found = this.findBoneEntity(child, boneName);
407
+ if (found) {
408
+ return found;
409
+ }
460
410
  }
461
- // ----------------------------------------
462
- // Utilities
463
- // ----------------------------------------
464
- convertColor(color) {
465
- const r = Math.round(255 * (color.rM ?? 1) + (color.rO ?? 0));
466
- const g = Math.round(255 * (color.gM ?? 1) + (color.gO ?? 0));
467
- const b = Math.round(255 * (color.bM ?? 1) + (color.bO ?? 0));
468
- const a = color.aM ?? 1;
469
- if (a < 1) {
470
- return `rgba(${r}, ${g}, ${b}, ${a})`;
471
- }
472
- return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`;
411
+ return null;
412
+ }
413
+ // ----------------------------------------
414
+ // Animation Conversion
415
+ // ----------------------------------------
416
+ convertAnimation(anim, frameRate) {
417
+ return {
418
+ name: anim.name,
419
+ duration: anim.duration / frameRate,
420
+ frameRate,
421
+ playTimes: anim.playTimes ?? 0,
422
+ fadeInTime: anim.fadeInTime ?? 0,
423
+ bones: anim.bone?.map((timeline) => ({
424
+ name: timeline.name,
425
+ translate: timeline.translateFrame,
426
+ rotate: timeline.rotateFrame,
427
+ scale: timeline.scaleFrame,
428
+ legacy: timeline.frame
429
+ })),
430
+ slots: anim.slot?.map((timeline) => ({
431
+ name: timeline.name,
432
+ display: timeline.displayFrame,
433
+ color: timeline.colorFrame,
434
+ legacy: timeline.frame
435
+ })),
436
+ ffd: anim.ffd,
437
+ ik: anim.ik,
438
+ zOrder: anim.zOrder,
439
+ events: anim.frame
440
+ };
441
+ }
442
+ // ----------------------------------------
443
+ // Utilities
444
+ // ----------------------------------------
445
+ convertColor(color) {
446
+ const r = Math.round(255 * (color.rM ?? 1) + (color.rO ?? 0));
447
+ const g = Math.round(255 * (color.gM ?? 1) + (color.gO ?? 0));
448
+ const b = Math.round(255 * (color.bM ?? 1) + (color.bO ?? 0));
449
+ const a = color.aM ?? 1;
450
+ if (a < 1) {
451
+ return `rgba(${r}, ${g}, ${b}, ${a})`;
473
452
  }
474
- async readFile(path) {
475
- if (typeof globalThis.process !== 'undefined' && globalThis.process.versions?.node) {
476
- const fs = await import('fs');
477
- return fs.readFileSync(path, 'utf-8');
478
- }
479
- else if (typeof fetch !== 'undefined') {
480
- const response = await fetch(path);
481
- return response.text();
482
- }
483
- throw new Error('Unable to read file in current environment');
453
+ return `#${r.toString(16).padStart(2, "0")}${g.toString(16).padStart(2, "0")}${b.toString(16).padStart(2, "0")}`;
454
+ }
455
+ async readFile(path) {
456
+ if (typeof globalThis.process !== "undefined" && globalThis.process.versions?.node) {
457
+ const fs = await import("fs");
458
+ return fs.readFileSync(path, "utf-8");
459
+ } else if (typeof fetch !== "undefined") {
460
+ const response = await fetch(path);
461
+ return response.text();
484
462
  }
463
+ throw new Error("Unable to read file in current environment");
464
+ }
485
465
  }
486
- // ============================================================
487
- // Factory Function
488
- // ============================================================
489
466
  function createDragonBonesImporter() {
490
- return new DragonBonesImporter();
467
+ return new DragonBonesImporter();
491
468
  }
492
-
493
469
  exports.DragonBonesImporter = DragonBonesImporter;
494
470
  exports.createDragonBonesImporter = createDragonBonesImporter;