I am pretty sure Unity should have this functionality, but I didn’t find anything about it in the documentation.
Is there any way I can choose to remove/select certain objects (or, even better, certain parts of the script) when doing a build? For example, I may want to have specifics sprites for Mobile builds, another for PC builds and then another for Consoles, or different options, etc.
Thank you in advance.
That’s because there’s many ways to do this.
A scripting define symbol, editable per platform in Player Settings.
With Addressables package. May require loading different assets based on current runtime platform, or it’s configurable - don’t know.
With Localization package and Platform Overrides.
Using a custom build script.
Or by creating separate scenes/prefabs with platform-specific references.
1 Like
Another simple way to change things at build time within a script is conditional compilation.