Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 JtheSpaceC · Dec 08, 2015 at 11:59 AM · webplayerifconditional

#if UNITY_WEBPLAYER been removed?

Hi. I've googled the topic and checked Answers but this hasn't been addressed in Unity 5 as far as I can see.

I'm using code:

alt text

As you can see, the WEBPLAYER if isn't behaving. According to documentation this should be a valid line of code, but it didn't auto-prompt at all and the actual command (Application.LoadLevel(0)) appears as if commented out.

Has the functionality been removed because Unity is moving away from the Web Player? How else could I get the web player to do (x) if this function is called when playing via my website?

Thanks Kevin

capture.png (14.4 kB)
Comment
Add comment · Show 2
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 JtheSpaceC · Dec 07, 2015 at 08:25 PM 0
Share

UPDATE: After a Unity restart, the next time I opened $$anonymous$$onoDevelop the line looked functional. Upon testing, it was. I don't know why it didn't respond initially. Please ignore this question.

avatar image simone9725 · Dec 09, 2015 at 09:44 AM 0
Share

I have the same problem but it doesn't work

1 Reply

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

Answer by Bunny83 · Dec 09, 2015 at 12:08 PM

Well, you probably had set the targetplatform to Standalone initially. When you change the targetplatform to Webplayer you have to sync the MonoDevelop project, otherwise the new settings won't apply.

and the actual command (Application.LoadLevel(0)) appears as if commented out.

Of course it appears like that since this is a preprocessor command. The code is literally commented out because the symbol "UNITY_WEBPLAYER" is not defined when you have not compiled your code for webplayer. Likewise when UNITY_WEBPLAYER is defined, other symbols like UNITY_STANDALONE or UNITY_ANDROID, .... are not defined and therefore the code in those sections is commented out. It won't actually exist in a build version.

As i said preprocessor symbols affect only the behaviour of the compiler. If you change the platform in Unity you should sync the MonoDevelop project to update the settings and cause a recompile of your project.

Comment
Add comment · 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

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

6 People are following this question.

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

Related Questions

Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers

Else and If 2 Answers

How to use conditionals with delegates? 1 Answer

|| conditional statement not working 1 Answer

Webplayer not recognized in IE and Facebook 1 Answer


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