Add files to cache

Hello,

I have a component that manage and preload all assets before Phaser game even created.

Is any good way to add preloded assets (images, sounds etc) to Phaser without using loader.
In Phaser 2 was a straight forward method to do that, however in Phaser 3 it different and i actually cant figure out how to do it properly.

Can anyone advice please?

Well the game needs to exist before you load assets to it; that’s basically what the preload method is for. If you’d like, you can create an initial scene that just handles all asset loads.

this.textures.addImage(…) etc.
this.cache.json.add(…) etc.

It’s look like a good way