Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 ceo1207 · May 10, 2016 at 05:55 AM · editorapplication.quit

how to quit the application in the editor of u3d?

if a script has a endless loop,when i use play mode,the unity may get dead,how can i stop the script?

and when i debug the program,how can i quit the application in the source code.i try to use Application.Quit().but the manual says that: Quits the player application. Quit is ignored in the editor or the web player.

so are there some else methods to quit?

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
4

Answer by tanoshimi · May 10, 2016 at 06:04 AM

I don't think you want to quit the editor, just to stop play mode.

 #if UNITY_EDITOR
      UnityEditor.EditorApplication.isPlaying = false;
 #else
      Application.Quit();
 #endif
Comment
Add comment · Show 3 · 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 ceo1207 · May 10, 2016 at 12:52 PM 0
Share

you've got my point.thanks a lot~

avatar image ceo1207 · May 10, 2016 at 12:56 PM 0
Share

but is there some button in editor to stop the play mode. Because sometimes i may not find some problems such as a endless loop,then if i choose to play,i can not quit unless to quit unity thread forcely.

avatar image tanoshimi · May 10, 2016 at 01:25 PM 1
Share

The button in the editor to stop play mode is the big blue play button at the top of the screen. If you've created an infinite loop, such as by writing while(true) {i++} in your Update(), then there's not much you can do - your program loop will continue to iterate over that tiny little block so it won't ever get a chance to listen for events such as keypresses or break commands. If you think you might be about to create an infinite loop, make sure to save your scene before you hit play. And don't use while() unless you're sure that an exit condition can be met.

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

Script inheiritence and finding a certain component 1 Answer

Custom editor array without serialized object 2 Answers

Screen.LockCursor working in editor but not in webplayer 2 Answers

Editor scripting - How to show the Assets menu as a context menu 1 Answer

Manipulate objects in Editor mode via Script 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