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 ocramot · Mar 24, 2014 at 03:00 PM · editor-scriptingbuildpipelinesave scene

How to automatically edit and build a project by script?

Hello guys, I have a somewhat complex task to do, and I'd like some advice.

I want to do (well, MY CUSTOMER wants me to do) a web-based Content Management System that will allow to interface the user with a (running or not) instance of Unity Editor and then edit and build a project composing a limited set of predefined objects, scenes and actions.

Mind that I'm not talking about something like the Team License: there will be only a single person working on the project, it's just that he will not be on the same machine of the Unity Editor (and the Unity Player will be on a third machine, ideally), and this person will not be trained in the use of Unity, nor allowed to do some actions (e.g. he will be able to import new textures but not to create materials or shaders; he will clone scenes but not create new ones or change the objects in them, except for some specific properties). There will be a predefined set of scenes (basically, each scene will be a room, and each door will allow the player to pass from one scene to another), and each scene will contain some predefined objects.

So basically, this CMS will need to do something like:

  1. Duplicate scenes;

  2. change components properties on some GameObjects already present in the scene (e.g., change texture of a material, or change the value of some script's public parameters);

  3. Add the various scenes to the building list;

  4. Save scenes, save project, build project, etc.

I'm not asking how to build a web service able to receive these informations, that's another problem ;) I wonder if I can have an external program (in any language) able to accomplish these operations without having to manually open the Unity Editor.

I have seen that I can build a project via external script, and also create and save a new scene, so point 4 won't be a problem..... still, how can I edit the list of scenes that will be included in the build?

I know that I can add elements at runtime and edit the Unity Editor, but is there a way to add objects to a (new or already existing) scene, and save, all at startup, before launching the build? Also, can I edit scenes that are not currently opened? And when I create/open a new scene, with some predefined objects in it, can I pass some parameters, somehow?

Having the ability to edit prefab files and other objects in the scene would be great, but I don't think it's possible (I tried opening .prefab and .unity files and they are binaries, if I'm right); do you think there could be a way to compose a set to script able to receive some input parameters at UnityEditor startup and then automate the creation and building of an entire project (either from scratch or not)?

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 vexe · May 13, 2014 at 11:41 PM 1
Share

You can send events (keys) to Unity - It'll help you with some of your points. If you can access the Unity machine, you could maybe write whatever you want to do in a $$anonymous$$enuItem that is executed by a certain key combo, say Alt+Shift+E - so then you just send that combo to Unity and it will execute that $$anonymous$$enuItem you set with whatever code have you...

0 Replies

· Add your reply
  • Sort: 

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

21 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

Related Questions

Unity Editor Scripting - Saving data in scriptable object problem 0 Answers

Getting the current BuildOptions 1 Answer

Set dynamicBatching player setting via editor script? 0 Answers

Add/Remove scene to build settings from editor script and run levels in editor 0 Answers

Bind to OnWillSaveAssets and force to save my scene 0 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