本文整理汇总了Java中com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader类的典型用法代码示例。如果您正苦于以下问题:Java AsynchronousAssetLoader类的具体用法?Java AsynchronousAssetLoader怎么用?Java AsynchronousAssetLoader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AsynchronousAssetLoader类属于com.badlogic.gdx.assets.loaders包,在下文中一共展示了AsynchronousAssetLoader类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: call
import com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader; //导入依赖的package包/类
/** Loads parts of the asset asynchronously if the loader is an {@link AsynchronousAssetLoader}. */
@Override
public Void call () throws Exception {
AsynchronousAssetLoader asyncLoader = (AsynchronousAssetLoader)loader;
if (dependenciesLoaded == false) {
dependencies = asyncLoader.getDependencies(assetDesc.fileName, resolve(loader, assetDesc), assetDesc.params);
if (dependencies != null) {
manager.injectDependencies(assetDesc.fileName, dependencies);
} else {
// if we have no dependencies, we load the async part of the task immediately.
asyncLoader.loadAsync(manager, assetDesc.fileName, resolve(loader, assetDesc), assetDesc.params);
asyncDone = true;
}
} else {
asyncLoader.loadAsync(manager, assetDesc.fileName, resolve(loader, assetDesc), assetDesc.params);
}
return null;
}
示例2: call
import com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader; //导入依赖的package包/类
public Void call()
{
AsynchronousAssetLoader localAsynchronousAssetLoader = (AsynchronousAssetLoader)this.loader;
if (!this.dependenciesLoaded)
{
this.dependencies = localAsynchronousAssetLoader.getDependencies(this.assetDesc.fileName, this.assetDesc.params);
if (this.dependencies != null)
{
Iterator localIterator = this.dependencies.iterator();
while (localIterator.hasNext())
{
AssetDescriptor localAssetDescriptor = (AssetDescriptor)localIterator.next();
this.manager.injectDependency(this.assetDesc.fileName, localAssetDescriptor);
}
}
localAsynchronousAssetLoader.loadAsync(this.manager, this.assetDesc.fileName, this.assetDesc.params);
this.asyncDone = true;
}
while (true)
{
return null;
localAsynchronousAssetLoader.loadAsync(this.manager, this.assetDesc.fileName, this.assetDesc.params);
}
}
示例3: getLevelLoader
import com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader; //导入依赖的package包/类
@Override
public AsynchronousAssetLoader<TaflLevel, AssetLoaderParameters<TaflLevel>> getLevelLoader() {
return new TaflLevelDataLoader(new InternalFileHandleResolver());
}
示例4: handleAsyncLoader
import com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader; //导入依赖的package包/类
private void handleAsyncLoader()
{
AsynchronousAssetLoader localAsynchronousAssetLoader = (AsynchronousAssetLoader)this.loader;
if (!this.dependenciesLoaded)
if (this.depsFuture == null)
this.depsFuture = this.threadPool.submit(this);
do
{
while (true)
{
return;
if (this.depsFuture.isDone())
try
{
this.depsFuture.get();
this.dependenciesLoaded = true;
if (this.asyncDone)
{
this.asset = localAsynchronousAssetLoader.loadSync(this.manager, this.assetDesc.fileName, this.assetDesc.params);
return;
}
}
catch (Exception localException2)
{
throw new GdxRuntimeException("Couldn't load dependencies of asset '" + this.assetDesc.fileName + "'", localException2);
}
}
if ((this.loadFuture == null) && (!this.asyncDone))
{
this.loadFuture = this.threadPool.submit(this);
return;
}
if (this.asyncDone)
{
this.asset = localAsynchronousAssetLoader.loadSync(this.manager, this.assetDesc.fileName, this.assetDesc.params);
return;
}
}
while (!this.loadFuture.isDone());
try
{
this.loadFuture.get();
this.asset = localAsynchronousAssetLoader.loadSync(this.manager, this.assetDesc.fileName, this.assetDesc.params);
return;
}
catch (Exception localException1)
{
throw new GdxRuntimeException("Couldn't load asset '" + this.assetDesc.fileName + "'", localException1);
}
}