pozhupt 我现在有多个动作文件,是单独打包出来的,需要在游戏中进行动态加载切换,请问应该怎么做?demo中只能在ApplicationAdapter的create中加载,我想在游戏运行中,比如点击某个按纽时从外部加载动作文件然后切换,谢谢了
Nate Sorry for the late response! 这么晚才回复很抱歉! libgdx provides AssetManager for loading assets on a separate thread: libgdx提供AssetManager来在单独的线程上加载资产: https://github.com/libgdx/libgdx/wiki/Managing-your-assets You can use it to load your atlas and skeleton data on a separate thread. Some parts of the assets are always loaded on the OpenGL / game thread, like uploading textures to the GPU, but AssetManager handles that. I've added a SkeletonAssetManagerTest class showing how to use it: 您可以使用它在不同的线程上加载图集和骨架数据。 资产的某些部分总是加载在OpenGL /游戏线程上,例如将纹理上传到GPU,但是AssetManager可以处理它们。 我添加了SkeletonAssetManagerTest类来展示如何使用它: https://github.com/EsotericSoftware/spine-runtimes/blob/4.0-beta/spine-libgdx/spine-libgdx-tests/src/com/esotericsoftware/spine/SkeletonAssetManagerTest.java