In the Phaser runtime, assets are cached by key, see:
EsotericSoftware/spine-runtimesblob/4.1/spine-ts/spine-phaser/src/SpinePlugin.ts#L366
EsotericSoftware/spine-runtimesblob/4.1/spine-ts/spine-phaser/src/SpinePlugin.ts#L303
Those are managed by Phaser itself. Additionally, the SpinePlugin caches instantiated SkeletonData and Atlas instances, to reduce the number of times the .skel/.json/.atlas files need to be parsed:
EsotericSoftware/spine-runtimesblob/4.1/spine-ts/spine-phaser/src/SpinePlugin.ts#L200
EsotericSoftware/spine-runtimesblob/4.1/spine-ts/spine-phaser/src/SpinePlugin.ts#L231
In both cases, you can manually clear those caches using the respective methods of the Phaser Phaser.Cache.BaseCache
class. You can get the instance caches from the SpinePlugin, and the file caches from the Phaser "object".
On to Pixi. Do I understand correctly, that the randomValue
fixes your issue? Because it should. spine-pixi too uses a caching mechanism for skeleton data instances:
EsotericSoftware/spine-runtimesblob/4.1/spine-ts/spine-pixi/src/Spine.ts#L346
A SkeletonData
is constructed from an Atlas
instance, so even if you manage to reload the atlas through Pixi.Assets.add/load
, if you then call spine.Spine.from()
with the same key as previously, you'll get the old SkeletonData
bound to the old Atlas
. You can manually clear the spine.Spine.skeletonDataCache
as well in this case. I'm unsure if Pixi.Assets
does caching as well, I would assume it does. Please consult the Pixi docs on how to clear cached data (.atlas files, atlas page .png files, and .skel/.json files) through their API.