Search Unity

[Android APP] Does anyone know how to create a quit app function in Google Cardboard SDK?

Discussion in 'AR/VR (XR) Discussion' started by DavidPumpkin, Apr 22, 2017.

  1. DavidPumpkin

    DavidPumpkin

    Joined:
    Apr 5, 2017
    Posts:
    32
    Hi Guys,

    Does anyone know how to create a quit app function in Google Cardboard SDK? I found a cross in my

    APP at the left top corner , I did check the original code that in the SDK they have a quitApplication code there,

    However, when I press it on my phone, there are no any response at all, does anyone know why? thanks.


    have a good day
     
  2. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    Something like the following:

    Code (CSharp):
    1. void Update()
    2. {
    3.           if(Input.GetKeyUp(KeyCode.Escape))
    4.             {
    5.                Application.Quit();
    6.             }
    7. }
     
  3. DavidPumpkin

    DavidPumpkin

    Joined:
    Apr 5, 2017
    Posts:
    32
    Hi Joejo, thank you very much for your help but when I type in " Application.Quit(); " the Application will not turn to green, whats wrong with it? thank you
     
  4. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958