Store and Use image according to the User | PlayCanvas

183 Views Asked by At

i'm actually working on a PlayCanvas project to renderer some object with the texture i want.

My problem is, in PlayCanvas build , in the config.json there is a path for this texture like :

"type": "texture",
      "file": {
        "filename": "recto-texture-rgh-2.png",
        "size": 39758,
        "hash": "3e4fcfbb3cbdac2800baf9e799683a17",
        "variants": {},
        "url": "files/assets/76068866/1/recto-texture-rgh-2.png"
      },

So if i change the texture in this path , it change on the PlayCanvas.

But in my case what I would like is to be able to load certain images depending on the user. For example for a user A , it loads me the textures A For a user B, this loads me the textures B If you ever have an idea how to do it, I'm a taker! I've been on it for a while without finding anything.

1

There are 1 best solutions below

0
On

you will have to add both the details of the textures on the config.json file first. The loading of texture logic will be written in any other script and not in config.json file.