- Home /
Multiple webplayer platforms
Is it possible to define multiple build settings and pre-processor directives for the webplayer? Or a custom build platform for the webplayer?
The use case for this is to deploy my game across multiple different websites, each which has a different API set up, screen resolution, monetisation etc. I'd like to be able to automatically strip code that does not belong to each website from the build. Essentially building a different file for each website.
If this is not possible my fall back will be checking the url at runtime, and behaving accordingly.
Answer by tanoshimi · Oct 04, 2014 at 10:52 AM
I don't know about build settings, but you can define custom pre-processor directives from the "Other Settings" of the player settings:
Then use #if WEBSITE1 ...
etc.
Also http://docs.unity3d.com/Manual/PlatformDependentCompilation.html
I'm mostly following you here. How do I go about telling Unity which website I'm targeting? If I simply use website1 in the scripting defines symbols and remove website2 will this remove all of my #if WEBSITE2 code? Or do I need to explicitly tell Unity which directives to use?
Seems like a reasonably solid approach. I will experiment and see what I can figure out.
So this works quite well.
By changing the Scripting Define Symbols I can achieve different behaviour for each build. Changing the symbols works in the editor too, making it easy to test functionality.
Your answer
Follow this Question
Related Questions
Omit files based on build type 1 Answer
Switching platforms - should you back up your assets folder or use a separate one per platform 1 Answer
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers
What can be wrong with my Internet Explorer 8.0 installation/settings? 1 Answer
Unity web player for Ubuntu? -1 Answers