如何在 overlap2d 中使用 ResourceManager 加载资源?

How to load assets using ResourceManager in overlap2d?

我正在使用 this tutorial 开始使用 Overlap2D。

遗憾的是他们已经从 DefaultAssetManager 切换到 ResourceManager 而没有更新教程。

这是使用DefaultAssetManager的代码。

    // Initializing asset manager
    assetManager = new ResourceManager();

    // providing the list of sprite animations which is one in this case, to avoid directory listing coding
    assetManager.spriteAnimationNames = new String[1];
    assetManager.spriteAnimationNames[0] = "bird";

    // loading assets into memory
    assetManager.loadData();

是否有人有更新的教程或知道如何修复此错误?

看看这个新教程:http://overlap2d.com/quick-start-setting-up-runtime-video/

它应该可以回答您的所有问题。

但简而言之,最简单的方法是为场景加载器使用空构造函数而忘记资源管理器让它为您完成所有工作,或者在 rm 上使用 initAllResources(如评论中所述),让它加载所有。