Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 Grazzt · Mar 22, 2015 at 01:19 AM · program

Is there any Unity API/Lib I can use in my program?

What I'm doing now: open scene in editor -> I setup light,camera,etc. -> build standalone

What I want: open scene in a program -> the program setup light,camera,etc. -> the program build standalone

Is there any way to support this?

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
1

Answer by Sisso · Mar 22, 2015 at 01:21 AM

No. But you can achieve it using command line. You can execute a script in unity batch and create builds.

http://docs.unity3d.com/Manual/CommandLineArguments.html


You can use it for anything that you can do in the real editor. You can execute any code using -executeMethod , from docs:

"Execute the static method as soon as Unity is started, the project is open and after the optional asset server update has been performed. This can be used to do continous integration, perform Unit Tests, make builds, prepare some data, etc."

Here is a example that I use to update build configuration for automatic builds (extracted and not tested :P).

Command line:

 "C:\Program Files (x86)\Unity\Editor\Unity.exe" -batchmode -quit -logFile "output.log" -projectPath C:/pathtoproject -executeMethod "AutoBuild.IncVersion"

Class that load ScriptableObject from resource and update it and save (automatic by dirt flag):



 using UnityEngine;
 using UnityEditor;
 
 class AutoBuild
 {
     public static void IncVersion()
     {
         var buildInfo = Resources.Load<BuildInfo>("BuildInfo");
         buildInfo.versionCode = buildInfo.versionCode + 1;
         buildInfo.buildDate = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ");
         buildInfo.version = buildInfo.majorVersion+"."+buildInfo.versionCode;
         EditorUtility.SetDirty(buildInfo);
     }
 }

Theses links could help too:

  • http://docs.unity3d.com/Manual/ModifyingSourceAssetsThroughScripting.html

  • http://docs.unity3d.com/ScriptReference/EditorApplication.html

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 Grazzt · Mar 23, 2015 at 01:31 AM 0
Share

Thanks! Is this cmd line only for builds or I can use it to modify my scene? If it can modify the scene, where can I find related documents? A keyword or class name is enough so I can search myself.

avatar image Grazzt · Mar 24, 2015 at 01:16 AM 0
Share

Awesome! Thanks very much!

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

What is the best animaiton program? 1 Answer

How do you create a program to link scenes together? 1 Answer

what is a good texturing program thats NOT gimp. 0 Answers

FPS Level Design Workflow (is AutoCAD viable?) 0 Answers

Beginner to all of this - What other programs to I need to make new stuff, and where is a good tutorial for people with almost zero prior experience? 4 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