本文整理匯總了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);
}
}