Lets say I have a project that includes 2 games with all the assets for each game.
When I build the project I want to be able to choose that assets from only one game gets included in the build but the assets from the other game do not get included. Is there any way to do this in Playcanvas?
If not, is there another approach for this as, I want to keep everything as a single project if possible.
You could tag the assets and then when the build is done, you could process the zip file and strip those out?
What we do is that we have a master branch that has shared assets. And then each game is in its own branch, merging master into them. This way each game can have own assets without conflicting with other games.
That sounds interesting but pretty complicated (to me at least). Especially when my team members (8!) each have their own branches as well, along with separate branches for some of the environment templates; I suspect things could get messy fast
Also, we are already well into development and so re-organizing everything like that sounds like it would take a lot of work.
I think the zip file processing idea sounds like it could work well and might be the simplest approach for us at this time…
Just keep in mind the conflicting script and other assets names, if they are all under the same branch. Not a big deal if you have only a few games, but will become an issue when the number of games grow.
Im just looking briefly at the structure of the zip. I can see that I could look at the projectID.JSON for all the entities that have a certain tag, and the resulting entity name looks something like:
That’s all fine, but then I can see anything in the files/assets where I could delete anything with this name.
I guess my next question is; how do I find the files/assets related to entities so I can delete them? Maybe Im looking at the wrong JSON file?
Those are entities in the scene hierarchy. For assets you want to look into config.json.
ok I think I see it. So I need to check through all the
entities>tags and find the entities with tags I want to delete.
Then I search through just those entities…
get this number for each asset ( eg: “asset” : 127823327)
…and then delete all the folders in files/assets with those names.
Sound about right?
I tried to search through this manually and the first 2 assets I found dint actually have any corresponding folder in the files/asset directory of the build. Why would this be? Could they be marked as ‘exclude from build’ in the editor but still show up in the JSON?