Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Kiwasi · Oct 04, 2014 at 06:28 AM · webplayerplatformspreprocessor

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.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

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:

alt text

Then use #if WEBSITE1 ... etc.

Also http://docs.unity3d.com/Manual/PlatformDependentCompilation.html


symbols.jpg (6.2 kB)
Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Kiwasi · Oct 05, 2014 at 02:28 AM 0
Share

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.

avatar image Kiwasi · Oct 05, 2014 at 10:24 AM 0
Share

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

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

27 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges