A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
docs(spine): clarify version-based runtime dispatch (no double tick)
esengine5b0b767382ca
diff --git a/sdk/src/spine/SpineManager.ts b/sdk/src/spine/SpineManager.tsindex a7e52faad..85621562c 100644--- a/sdk/src/spine/SpineManager.ts+++ b/sdk/src/spine/SpineManager.ts@@ -52,6 +52,15 @@ export class SpineManager {if (!version) return null;+ // Version routing, see SpinePlugin spineUpdateSystem for the+ // full story. When a 4.2 entity shows up and no 4.2 JS factory+ // is registered, we leave it for the native C++ runtime+ // (`spine_setNeedsReload` stays at its default of true, so+ // SpineCpp.update ticks it each frame). For older versions+ // (3.8 / 4.1) we hand the entity off to the JS runtime by+ // disabling needsReload on the C++ side and loading into+ // ModuleBackend. The two runtimes therefore tick disjoint+ // entity sets — there is NO double update per entity.if (version === '4.2' && !this.factories_.has('4.2')) {this.entityVersions_.set(entity, '4.2');return '4.2';diff --git a/sdk/src/spine/SpinePlugin.ts b/sdk/src/spine/SpinePlugin.tsindex 25ca91d00..67682db5a 100644--- a/sdk/src/spine/SpinePlugin.ts+++ b/sdk/src/spine/SpinePlugin.ts@@ -85,6 +85,26 @@ export class SpinePlugin implements Plugin {this.spineManager_?.removeEntity(entity);});+ // Per-frame spine tick. Both calls fire unconditionally, but+ // they tick DISJOINT entity sets — this is not a double-tick:+ // - SpineCpp.update(registry, dt) advances every entity+ // whose C++ `needsReload`+ // flag is true. That's+ // the 4.2 set.+ // - spineManager_.updateAnimations(dt) iterates+ // SpineManager.backends_+ // (ModuleBackend+ // instances, one per+ // loaded JS runtime+ // version — 3.8 / 4.1).+ // Each backend advances+ // only its own entities.+ //+ // SpineManager.loadEntity does the routing:+ // - version '4.2': sets entityVersions_['4.2'] and returns,+ // leaving the entity under C++ control;+ // - version '3.8' / '4.1': calls spine_setNeedsReload(false)+ // to hand the entity off to the JS runtime.const spineUpdateSystem: SystemDef = {_id: Symbol('SpineUpdateSystem'),_name: 'SpineUpdateSystem',