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 tzamora · May 12, 2013 at 05:14 PM · editorrestart

Unity Editor: Button to restart unity.

Hi people. I have a little problem with my installed version of unity 3.5.7, it sometimes just stops working and freezes a lot. The problem is caused because ( I think ) have a lot of plugins installed in my project.

I have to keep saving the project several times in order to keep my project safe from this crashes. The thing is that if unity freezes, I have to use the Force Quit window of osx to reopen unity again, and when I quit unity in this way, the project is not completely saved. If I reopen the project, the changes I had before the crash are lost, its like the save project button in the menu were not really saving the project, but waiting until unity closes itself that the project changes are commited.

In order to fix this I decided to restart unity each time I save ( its not frustrating since a Solid State Drive does well the job loading everything ), so I do the following:

  1. Save scene

  2. Save project

  3. close unity

  4. open unity

I already know how to save a scene ( and save a project too, I think -_- ) in code.

The question is: Is it posible to code that unity close itself and reopens itself again. Like firefox when you restart it; and put all this steps together to create my custom "Save" button.

Thanks.

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 Nidre · May 13, 2013 at 01:54 PM 1
Share

i don't remember the exact code but i had a similar case where i wanted to copy the whole project to a new folder then open it and close the current project.

First of all,i did save the scene and project by code. Then you can call Unity.exe and pass the folder of project as argument again by code. Then in the next line close the current unity process.

That way you should be able to restart unity and keep your changes.

But better backup before trying.

Also refer to http://answers.unity3d.com/questions/16675/running-an-external-exe-file-from-unity.html this to call Unity.exe or if you are on windows platform you can try using windows api to call the Unity.exe which is what i did before.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by DaveA · May 12, 2013 at 05:38 PM

I think you would want to launch an external program, probably .bat or other simple script, that opens unity.

http://answers.unity3d.com/questions/16675/running-an-external-exe-file-from-unity.html

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

16 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

Related Questions

HideFlags on children of visible objects. 3 Answers

How to restart a level with countdown? 4 Answers

How to Save an multidimensional array trough editor script 1 Answer

Fastest way to instantiate and move multiple game objects in the editor 3 Answers

Stop Unity and release memory in iOS App 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