DragonBones / DragonBonesJS

DragonBones TypeScript / JavaScript Runtime
MIT License
746 stars 320 forks source link

Phaser 3 - load assets into cache instead directly into factory #78

Closed pavels closed 5 years ago

pavels commented 5 years ago

This solves the problem when you want to load dragonbones assets in different scene than to use them in. Phaser 3 has Cache store exactly for this purpose, this uses it.

It has one problem, when you use the asset first time, it is not found in the factory instance and warning is printed into console, than if the resource is in cache, it is loaded. There is no simple way to suppress this warning, only to check if the asset is in factory before trying to load it which will result in searching for it twice.

jcyuan commented 5 years ago

thanks @pavels there will be still a few changes based on your PR, and mainly for multi-screen problem too.