Search Unity

Quit application?

Discussion in 'Daydream' started by duncangroberts, Jan 5, 2017.

  1. duncangroberts

    duncangroberts

    Joined:
    Jul 22, 2015
    Posts:
    69
    Hi there,
    I'm close to finishing a first build of my first daydream app, in fact my first app ever and am having trouble when double checking all the quality requirements. Basically, when I try and quit the app by touching the cross in the top left hand corner, nothing happens. Is there a script I need to add like application.quit or anything?
    Thanks so much,
    Duncan
     
  2. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    Are you using the Google Unity SDK?
     
  3. duncangroberts

    duncangroberts

    Joined:
    Jul 22, 2015
    Posts:
    69
    I am yes, I have all the required prefabs in and am using the latest daydream preview build.
     
  4. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    You need to do the following someplace in your code:

    if (GvrViewer.Instance.BackButtonPressed) {
    Application.Quit();
    }

    Teleport.cs in the GVRDemo that comes with the Google Unity SDK will show you where they handle this.
     
  5. duncangroberts

    duncangroberts

    Joined:
    Jul 22, 2015
    Posts:
    69
    That's great, thanks so much.