當前位置: 首頁>>代碼示例>>Java>>正文


Java AssetManager.unload方法代碼示例

本文整理匯總了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));
	}
}
 
開發者ID:kyperbelt,項目名稱:KyperBox,代碼行數:14,代碼來源:GameState.java

示例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));
	}
}
 
開發者ID:kyperbelt,項目名稱:KyperBox,代碼行數:14,代碼來源:GameState.java

示例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));
	}
}
 
開發者ID:kyperbelt,項目名稱:KyperBox,代碼行數:13,代碼來源:GameState.java

示例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;
	}
}
 
開發者ID:mganzarcik,項目名稱:fabulae,代碼行數:11,代碼來源:DialoguePanelLoader.java

示例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();
}
 
開發者ID:mganzarcik,項目名稱:fabulae,代碼行數:20,代碼來源:CharacterCreationWindowLoader.java

示例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);
}
 
開發者ID:Quexten,項目名稱:RavTech,代碼行數:42,代碼來源:ShaderManager.java

示例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);
	}
}
 
開發者ID:mganzarcik,項目名稱:fabulae,代碼行數:7,代碼來源:ItemModel.java

示例8: unload

import com.badlogic.gdx.assets.AssetManager; //導入方法依賴的package包/類
public void unload(AssetManager am) {
	for (String fileName : loadedGames.values()) {
		am.unload(fileName);
	}
	loadedGames.clear();
}
 
開發者ID:mganzarcik,項目名稱:fabulae,代碼行數:7,代碼來源:SavedGameLoader.java

示例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();
}
 
開發者ID:mganzarcik,項目名稱:fabulae,代碼行數:7,代碼來源:StorySequencePanelLoader.java

示例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);
	}
}
 
開發者ID:mganzarcik,項目名稱:fabulae,代碼行數:6,代碼來源:CharacterCreationWindowLoader.java

示例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);
	}
}
 
開發者ID:mganzarcik,項目名稱:fabulae,代碼行數:14,代碼來源:LoadingScreens.java


注:本文中的com.badlogic.gdx.assets.AssetManager.unload方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。