Kotlin LibGDX资产依赖关系会降低进度

Kotlin LibGDX资产依赖关系会降低进度,kotlin,libgdx,Kotlin,Libgdx,这更多的是关于框架本身(特别是AssetManager)的一般性问题,而不是关于代码的问题 我一直在使用一个自定义加载程序来缓存我的纹理地图集的轮廓效果,当我注意到我的游戏加载状态下的进度条在某个点上下降了百分比。我的加载程序需要加载依赖项:一个基础图集和一个着色器(还有另一个深度纹理图集) 我的加载程序通常如下所示(在Kotlin中): 在寻找资料来源时,我不明白这是故意的还是我盲目地做了一些愚蠢的事情?(我也没有在维基上找到关于这个主题的东西) 编辑:调试打印语句如下所示: if (!ass

这更多的是关于框架本身(特别是AssetManager)的一般性问题,而不是关于代码的问题

我一直在使用一个自定义加载程序来缓存我的纹理地图集的轮廓效果,当我注意到我的游戏加载状态下的进度条在某个点上下降了百分比。我的加载程序需要加载依赖项:一个基础图集和一个着色器(还有另一个深度纹理图集)

我的加载程序通常如下所示(在Kotlin中):

在寻找资料来源时,我不明白这是故意的还是我盲目地做了一些愚蠢的事情?(我也没有在维基上找到关于这个主题的东西)

编辑:调试打印语句如下所示:

if (!assetManager.update()) {
    val progress = "${assetManager.progress * 100f}%"
    Gdx.app.debug("[DEBUG]", progress)
} else { ... }

它只是Java中的
AssetManager.getProgress()

显示如何计算percentage@icarumbas我编辑了这个问题。我实际上不计算任何东西,因此产生了关于AssetManager本身的问题percentage@icarumbas我编辑了这个问题。我实际上不计算任何东西,因此,关于AssetManager本身的问题就出现了。
[AssetManager] Queued: sprites/sprites.atlas, foo.bar.OutlineAtlas
[AssetManager] Loading: sprites/sprites.atlas, foo.bar.OutlineAtlas
[DEBUG] Loading: 0%
[AssetManager] Loading dependency: sprites/sprites.atlas, com.badlogic.gdx.graphics.g2d.TextureAtlas
[AssetManager] Loading dependency: sprites/depth.atlas, com.badlogic.gdx.graphics.g2d.TextureAtlas
[AssetManager] Loading dependency: shader/depth.frag, com.badlogic.gdx.graphics.glutils.ShaderProgram
[DEBUG] Loading: 0%
[AssetManager] Loaded: 20.16505ms shader/depth.frag, com.badlogic.gdx.graphics.glutils.ShaderProgram
[DEBUG] Loading: 25%
[AssetManager] Loading dependency: sprites/depth.png, com.badlogic.gdx.graphics.Texture
[DEBUG] Loading: 20%
[AssetManager] Loaded: 20.56412ms sprites/depth.png, com.badlogic.gdx.graphics.Texture
[DEBUG] Loading: 40%
[AssetManager] Loaded: 85.70349ms sprites/depth.atlas, com.badlogic.gdx.graphics.g2d.TextureAtlas
[DEBUG] Loading: 60%
[AssetManager] Loading dependency: sprites/sprites.png, com.badlogic.gdx.graphics.Texture
[AssetManager] Loading dependency: sprites/sprites2.png, com.badlogic.gdx.graphics.Texture
[AssetManager] Loading dependency: sprites/sprites3.png, com.badlogic.gdx.graphics.Texture
[AssetManager] Loading dependency: sprites/sprites4.png, com.badlogic.gdx.graphics.Texture
[DEBUG] Loading: 33%
[AssetManager] Loaded: 72.27248ms sprites/sprites4.png, com.badlogic.gdx.graphics.Texture
[DEBUG] Loading: 44%
[AssetManager] Loaded: 116.72272ms sprites/sprites3.png, com.badlogic.gdx.graphics.Texture
[DEBUG] Loading: 56%
[AssetManager] Loaded: 165.29959ms sprites/sprites2.png, com.badlogic.gdx.graphics.Texture
[DEBUG] Loading: 67%
[AssetManager] Loaded: 237.17233ms sprites/sprites.png, com.badlogic.gdx.graphics.Texture
[DEBUG] Loading: 78%
[AssetManager] Loaded: 341.5768ms sprites/sprites.atlas, com.badlogic.gdx.graphics.g2d.TextureAtlas
[DEBUG] Loading: 89%
[AssetManager] Loaded: 405.7238ms sprites/sprites.atlas, foo.bar.OutlineAtlas
if (!assetManager.update()) {
    val progress = "${assetManager.progress * 100f}%"
    Gdx.app.debug("[DEBUG]", progress)
} else { ... }