本文整理汇总了Java中com.badlogic.gdx.assets.AssetManager.unload方法的典型用法代码示例。如果您正苦于以下问题:Java AssetManager.unload方法的具体用法?Java AssetManager.unload怎么用?Java AssetManager.unload使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.assets.AssetManager
的用法示例。
在下文中一共展示了AssetManager.unload方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: unloadFonts
import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
public void unloadFonts() {
Array<BitmapFont> fvalues = fonts.values().toArray();
AssetManager am = game.getAssetManager();
unload_helper.clear();
for (int i = 0; i < fvalues.size; i++) {
unload_helper.add(fvalues.get(i).getData().fontFile.path());
}
fvalues.clear();
for (int i = 0; i < unload_helper.size; i++) {
am.unload(unload_helper.get(i));
}
}
示例2: unloadParticles
import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
public void unloadParticles() {
AssetManager am = game.getAssetManager();
unload_helper.clear();
particle_effects.clear();
for (int i = 0; i < pvalues.size; i++) {
unload_helper.add(pvalues.get(i));
}
pvalues.clear();
for (int i = 0; i < unload_helper.size; i++) {
am.unload(unload_helper.get(i));
}
}
示例3: unloadShaders
import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
public void unloadShaders() {
AssetManager am = game.getAssetManager();
unload_helper.clear();
shaders.clear();
for (int i = 0; i < svalues.size; i++) {
unload_helper.add(svalues.get(i));
}
svalues.clear();
for (int i = 0; i < unload_helper.size; i++) {
am.unload(unload_helper.get(i));
}
}
示例4: unload
import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
public void unload(AssetManager am) {
if (dialoguePath != null) {
ObjectSet<String> images = am.get(dialoguePath, Dialogue.class).getAllImages();
for (String image : images) {
am.unload(image);
}
am.unload(dialoguePath);
dialoguePath = null;
}
}
示例5: unload
import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
/**
* This will unload everything loaded by this loader.
*
* @param am
*/
public void unload(AssetManager am) {
for (String path : portraits.values()) {
am.unload(path);
}
portraits.clear();
for (CharacterModel model : models) {
am.unload(model.getAnimationTextureFile());
}
models.clear();
unloadFromStore(am, audioProfiles);
audioProfiles.clear();
}
示例6: add
import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
/** Adds new shader to ShaderManager, loads it using AssetManager.
*
* @param am - AssetManager instance
* @param key - shader identifier
* @param baseVertPath - path to vertex shader source
* @param baseFragPath - path to fragment shader source */
public void add (AssetManager am, String key, String baseVertPath, String baseFragPath) {
am.setLoader(String.class, new TextFileLoader(new InternalFileHandleResolver()));
FileHandle vertFh = null, fragFh = null;
String vertPath = shaderDir + "/" + baseVertPath;
vertFh = Gdx.files.internal(vertPath);
if (!vertFh.exists()) {
vertFh = Gdx.files.classpath(SHADER_CLASSPATH + "/" + baseVertPath);
vertPath = vertFh.path();
}
String fragPath = shaderDir + "/" + baseFragPath;
fragFh = Gdx.files.internal(fragPath);
if (!fragFh.exists()) {
fragFh = Gdx.files.classpath(SHADER_CLASSPATH + "/" + baseFragPath);
fragPath = fragFh.path();
}
if (!vertFh.exists())
throw new GdxRuntimeException("ShaderManager: shader '" + vertPath + "' does not exist!");
if (!fragFh.exists())
throw new GdxRuntimeException("ShaderManager: shader '" + fragPath + "' does not exist!");
if (am.isLoaded(vertPath))
am.unload(vertPath);
if (am.isLoaded(fragPath))
am.unload(fragPath);
am.load(vertPath, String.class);
am.load(fragPath, String.class);
// TODO dirty...
while (!am.isLoaded(vertPath) || !am.isLoaded(fragPath))
am.update();
// Gdx.app.log("ShaderManager", am.getProgress() + ", " +
// am.getLoadedAssets() + "/" + am.getQueuedAssets());
String vert = am.get(vertPath, String.class);
String frag = am.get(fragPath, String.class);
if (init(key, vert, frag))
shaderPaths.put(key, baseVertPath + ";" + baseFragPath);
}
示例7: unloadAssets
import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
public void unloadAssets() {
AssetManager am = Assets.getAssetManager();
for (Entry<String, Class<?>> asset : assetStore) {
am.unload(asset.key);
}
}
示例8: unload
import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
public void unload(AssetManager am) {
for (String fileName : loadedGames.values()) {
am.unload(fileName);
}
loadedGames.clear();
}
示例9: unload
import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
public void unload(AssetManager am) {
for (Entry<String, Class<?>> entry : loadedAssets) {
am.unload(entry.key);
}
loadedAssets.clear();
}
示例10: unloadFromStore
import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
private void unloadFromStore(AssetManager am, AssetMap store) {
for (Entry<String, Class<?>> entry : store) {
am.unload(entry.key);
}
}
示例11: unloadImages
import com.badlogic.gdx.assets.AssetManager; //导入方法依赖的package包/类
/**
* Unloads all images of the specified type (or default images
* if no type specific ones are found) from the supplied
* asset manager.
*
* @param type
* @param am
*/
public void unloadImages(String type, AssetManager am) {
for (String image : getImages(type)) {
am.unload(image);
}
}