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
4
Question by msknapp · Dec 27, 2011 at 10:18 PM · editor-scripting

Editor check if unity pro license installed

I'm writing an editor script that can build asset bundles, or it can build prefabs instead. I know that if I transfer this to a machine that does not have unity pro, it will not compile because I use some functions only available with the pro version. Basically what I wanted was:

#if UNITYPRO
// my code...
#endif

but that is not an option if you look here:
http://unity3d.com/support/documentation/Manual/Platform%20Dependent%20Compilation.html

Would somebody please tell me how I can use conditional compilation to check if unity pro is installed?

Comment
Add comment · Show 1
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 Jean-Fabre · Jan 05, 2012 at 03:37 PM 0
Share

the one api call I know off is http://unity3d.com/support/documentation/ScriptReference/PlayerSettings-advancedLicense.html that's really a shame we can script based on the pro or non pro. But I think if you write plugins as dll, unity ought to give you access to that kind of things no?

4 Replies

· Add your reply
  • Sort: 
avatar image
10

Answer by TonyLi · Jun 12, 2014 at 07:42 PM

For anyone who's still looking for an answer, this define is now available in Unity 4.5:

Scripting: Added UNITY PRO LICENSE define.

Comment
Add comment · Show 1 · 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 MMarxDev · Jan 25, 2015 at 06:14 AM 0
Share
 #if UNITY_PRO_LICENSE



avatar image
7
Wiki

Answer by kork · Dec 31, 2012 at 09:57 AM

Basically it should compile because the free version is basically the same version as the Pro version API-wise. There are checks in the code of the Unity internal classes which will simply log a message when calling a function that is Pro-only on Unity Free. Nevertheless you should be able to compile classes that use Unity Pro on Unity Free. You will just not be able to run them. If you want to check in your editor script if the currently run version is Unity Pro use:

 bool hasPro = UnityEditorInternal.InternalEditorUtility.HasPro()

And provide a meaningful message in your code should it require Unity Pro but runs on Unity Free.

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 kork · May 19, 2014 at 12:26 PM 1
Share

Well, the OP asked for a way to check this in the editor, and for that use case it's pretty much doing what the OP asked for ;).

avatar image Lohoris2 · May 19, 2014 at 02:28 PM 0
Share

Oh, my bad, I didn't notice.

avatar image
-2

Answer by TowerOfBricks · Dec 28, 2011 at 03:56 PM

Unfortunately, I don't think that is possible.

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
avatar image
0

Answer by Noah-1 · Jan 05, 2012 at 03:59 PM

The only thing I can think of is to make a script that reads the type of license the user has but that would be hard.

I would create a pop up message that asks if you have Unity pro or not and I would add a warning message saying : Warning if you do not own a copy of Unity pro this wont compile as expected.

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

10 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

Related Questions

How to use GetComponentsInChildren ( Example :- to print all children gameobject'sname ) 3 Answers

Custom Prfab Editor Window 0 Answers

Is it possible to determine wich Handles.PositionHandle is currently focused? 1 Answer

Editor Window/Scriptable object - null problem 2 Answers

Want to get the location of the GameView Window 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