Find out if key exists in cache?

Hi Everyone!

Does anyone know how to find out if a specific key exists in the cache?

I’ve tried this: Phaser.Cache.BaseCache.exists("assetKey") - but get an error.
It looks like it should work, but maybe I’m accessing it incorrectly?
(Phaser 3 API Documentation - Class: BaseCache)'key') etc.

Thanks @samme!

That works, although I discovered that images are in a separate location:

So I was able to check for an existence of an image key like this:

if (!["imageKey"]) {...

this.textures will do it.

1 Like