Jquery Phaser-清除加载状态和引导状态缓存DOM
我和你玩游戏。我想清除所有Jquery Phaser-清除加载状态和引导状态缓存DOM,jquery,image,caching,phaser-framework,Jquery,Image,Caching,Phaser Framework,我和你玩游戏。我想清除所有loadState和bootState缓存DOM,以删除图像链接 我实际上使用了Phaser.Cache来删除GameDOM中的所有缓存,它可以工作,但是loadState和bootState缓存仍然存在 当我使用Phaser.Cache时 game.cache = new Phaser.Cache(game); game.load.reset(); game.load.removeAll(); 清除游戏缓存结果 图像对象{{uu默认值={…},{uu缺少={…} _
loadState
和bootState
缓存DOM,以删除图像链接
我实际上使用了Phaser.Cache
来删除Game
DOM中的所有缓存,它可以工作,但是loadState
和bootState
缓存仍然存在
当我使用Phaser.Cache时
game.cache = new Phaser.Cache(game);
game.load.reset();
game.load.removeAll();
清除游戏
缓存结果
图像对象{{uu默认值={…},{uu缺少={…}
__默认对象{key=“\u default”,data=img,base={…},plus…}
__缺少对象{key=“\u缺少”,数据=img,基={…},加上…}
但是loadState
和bootState
缓存仍然存在
game.cache = new Phaser.Cache(game);
game.load.reset();
game.load.removeAll();
图像对象{{uu默认值={…},{uu缺少={…},
背景2={…},加上…}
__默认对象{key=“\u default”,data=img,base={…},plus…}
__缺少对象{key=“\u missing”,data=img,base={…},加上…}背景对象{key=“background”,
url=“data:image/jpeg;base64,/…q0xYqtMOKrDFiqz0sVf/9k=”,data=img,
加上…}
您需要清除每个状态
game.state.clearCurrentState();
phaser博士说:
此方法通过调用其关闭回调来清除当前状态。
该过程还将删除任何活动的tweens,重置相机,重置
输入,清除物理,删除计时器,如果设置,则清除世界和
缓存也是
你也可以使用
game.state.destroy(); // Removes all StateManager callback references to the State object, nulls the game reference and clears the States object
谢谢你的回复。此解决方案清除并重置我的所有游戏对象。我想保持所有对象的创建,只清理缓存状态。使用
game.cache=new Phaser.cache(游戏);game.load.reset();game.load.removeAll()代码>仅清除缓存。你有办法做到这一点吗?我想你不能用移相器。