spinnerbox Posted February 19, 2016 Share Posted February 19, 2016 I want to make several unit tests that test my loading functionality. That means i have to run Phaser.Cache.destroy() just so I make sure the assets were not loaded by the previous test. The problem is destroy() makes the cache null which is not what I want. I just want to clear the data it holds. I even tried this: game.cache = new Phaser.Cache(game); But it doesn't seem to be working. What should I do in this case? Link to comment Share on other sites More sharing options...
spinnerbox Posted February 19, 2016 Author Share Posted February 19, 2016 This probably will do the job: function clearGameCache () { game.cache = new Phaser.Cache(game); game.load.reset(); game.load.removeAll(); } Link to comment Share on other sites More sharing options...
Tutanchacon Posted May 11, 2022 Share Posted May 11, 2022 Hi Spinnerbox! At 2022, were you able to solve this problem? Tanks! Link to comment Share on other sites More sharing options...
Recommended Posts