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 DATuan91 · May 27, 2014 at 02:47 AM · androidsceneloadingquitback

Stop back key android from quitting application WHILE the scene is loading?

Hello. I'm using Unity 4.3.4.

If I press back key on android phone while the scene is loading, the entire application quits. I have already known the code below.

  if (Input.GetKeyDown(KeyCode.Escape))    
    {    
         return;    
    }

But this solution only work if scene is loading completely. I have already add DonDestroyOnLoad to script, but nothing changes.

If anyone find out solution, pls let me know. Thank in advance

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
0

Answer by SteelArrow21 · May 27, 2014 at 02:56 AM

Rather than doing: return; try: end;

Comment
Add comment · Show 5 · 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 DATuan91 · May 27, 2014 at 03:01 AM 0
Share

What is the "end"? There nothing like this in Unity. Can you be more specific?

avatar image SteelArrow21 · May 27, 2014 at 03:38 AM 0
Share

Sorry, I'm thinking of another program. Is this possible?

 If(Input.Get$$anonymous$$eyDown($$anonymous$$eyCode.Escape))
      {
           return null;
      }
avatar image DATuan91 · May 27, 2014 at 03:41 AM 0
Share

No, same as before: only work if the scene is completely loading, no effect WHILE the scene loading. I have already tried DonDestroyOnLoad, but not fix.

avatar image SteelArrow21 · May 27, 2014 at 04:01 AM 0
Share

Is this line of code in the same script as the level loading script? If it is, then move it. While the level is loading, all the other code in the script pauses. $$anonymous$$ake a separate script for the backing out and make sure its enabled.

avatar image DATuan91 · May 29, 2014 at 02:28 AM 0
Share

I have tried add another script contains Back-key process code (on same GameObject) and outside the script contains Level-loading code but no work at all. $$anonymous$$aybe I have missed something. Anyway, thank for your help.

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

Scene load before video (Handled Android) 0 Answers

How to have the scene load after a few seconds 1 Answer

Help with Exception: Error building Player on Android 2 Answers

Android Error 0 Answers

How do I detect if a scene is being loaded during edit time? 5 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