use of com.badlogic.gdx.graphics.g3d.particles.ResourceData.AssetData in project libgdx by libgdx.
the class ParticleEffectLoader method getDependencies.
@Override
public Array<AssetDescriptor> getDependencies(String fileName, FileHandle file, ParticleEffectLoadParameter parameter) {
Json json = new Json();
ResourceData<ParticleEffect> data = json.fromJson(ResourceData.class, file);
Array<AssetData> assets = null;
synchronized (items) {
ObjectMap.Entry<String, ResourceData<ParticleEffect>> entry = new ObjectMap.Entry<String, ResourceData<ParticleEffect>>();
entry.key = fileName;
entry.value = data;
items.add(entry);
assets = data.getAssets();
}
Array<AssetDescriptor> descriptors = new Array<AssetDescriptor>();
for (AssetData<?> assetData : assets) {
// If the asset doesn't exist try to load it from loading effect directory
if (!resolve(assetData.filename).exists()) {
assetData.filename = file.parent().child(Gdx.files.internal(assetData.filename).name()).path();
}
if (assetData.type == ParticleEffect.class) {
descriptors.add(new AssetDescriptor(assetData.filename, assetData.type, parameter));
} else
descriptors.add(new AssetDescriptor(assetData.filename, assetData.type));
}
return descriptors;
}
Aggregations