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 DannyB · Sep 02, 2013 at 07:42 AM · editorbuildbuild settingsplayersettings

Changing Build Settings by code

One of the repetitive tasks I wish to avoid, is manually updating the version number in the build settings every time I build.

Is there a way to update this value by code? I found PlayerSettings.bundleVersion, but not sure how to use it so it updates before each build. I wish to do something like:

 static void CallMeBeforeBuild() {
     PlayerSettings.bundleVersion = MetaData.version; 
     // MetaData is my own static class
 }

I also found the manual for post processing script, but I am not sure this is what I need.

Comment
Add comment · Show 5
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 sooncat · Sep 02, 2013 at 08:01 AM 1
Share

PlayerSettings.bundleVersion ?

avatar image DannyB · Sep 02, 2013 at 08:02 AM 0
Share

:) I guess I edited the question while you were commenting. Yeah, found that. But not sure now where to put it so it is automatically called on each build. See the updated question.

avatar image frarees · Sep 02, 2013 at 08:40 AM 0
Share

I used to trigger it manually (via $$anonymous$$enuItem), as PostProcessSceneAttribute is not yet working properly on 4.2 (i.e. does not execute before building, at least not in mobile platforms). Just use PlayerSettings.bundleVersion (note that you can get and set this value)

avatar image DannyB · Sep 02, 2013 at 08:46 AM 0
Share

Well, updating it by menu item is almost as labor intensive as editing it in the player settings... :)

avatar image frarees · Sep 02, 2013 at 11:20 AM 0
Share

Yeah... A bit faster if you create a shortcut for it. Hope they fix PostProcessSceneAttribute soon.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by kork · Sep 02, 2013 at 01:27 PM

You could do without scripting using the uTomate extension. With this you can set up an automation plan, where you first set up the player settings and then build your player(s). Then you can run the plan with a single click.

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 DannyB · Sep 02, 2013 at 04:34 PM 0
Share

Thanks for the plugin reference, may become handy some time, but it is way over the top for what I need.

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

19 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

Related Questions

Unity Builds Old Version of my Scene 1 Answer

different project for different platforms 0 Answers

Set Bundle Version Code through editor script 3 Answers

Distribute terrain in zones 3 Answers

Dialog Box in Build Settings 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