当前位置: 首页>>代码示例>>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;未经允许,请勿转载。