Multiple products one project - how?

I have a Unity project that I use to generate multiple products. It’s essentially the same product with certain features turned on/off.

My problem is that once I integrate any Untiy services (eg ads, analytics, etc) there seems to be no simple way to easily do a build with them disabled.

I have some products where I want to show ads and in others I don’t. I don’t want to include the ads components to my build if it’s not used etc.

Am I missing something?

Some plugins let you specify which platforms they are included in. .dll files for example have platform checkboxes that you can check and uncheck accordingly.

unfortunately assets and scripts are not so simple… Firstly you should ask yourself if not including them in platforms where they are not needed is worth bothering. If the code is not run and no bugs are created as a result and build sizes are acceptable then maybe just ignore it.

If that’s not an option the it gets harder. In older versions of Unity I’ve made build scripts that create a unity asset package out of all the assets I don’t want (I put them in specific folders to make the code easy) and then after the build completes I reimported all those assets back. I only did this to save build size back in the 20MB limit days of iOS, I don’t really think there’s any other reason to do it but I could be wrong.

What’s type of files do you specifically want to exclude?

You mentioned Ads. I’d say that a good Ad platform should do this automatically, I believe Fyber and SuperSonic do. And from what I’ve heard they also happen to be the best performing Ad Mediation platforms on average.

Edit: I forgot to mention the plugin folders. I think if assets are in a platform folder within plugins then it’s not included in other platform builds…? I could be wrong about this though. I’ve never used the feature intentionally.

Edit2: I just tried it by dropping a material into Plugins/Android and made an iOS build. The material was included in the build… so seems you need a more complicated solution.

Thanks Anthony,

I have no issue with standard assets/code etc these I can handle easily.

The issue is the Unity services (ads, analytics, etc) they get added to the project automagically when they are enabled and shove stuff in your builds. It seems I have no control over this at build time.

For mobile, the additional size is a real issue, and even if I don’t use ads, it’s still initialised and fails in a build if it’s been enabled.

Note, the only way I’ve found to even disable them for a build without unlinking the project (don’t want to do that) is to log out so I can’t use them!

Oh right… hmm I only use unity analytics myself and i want that in all builds. I use unity ads but i use a plugin for the ad mediation platform I mentioned before. Maybe try doing it that way instead of using unity ads directly?

I actually feel pretty silly, I just noted I can simply disable the ads service… Maybe that’ll do all that I need!

(what was I thinking??)