Search Unity

Windows Phone Failed Certification on Back Key Press ?

Discussion in 'Windows' started by Darjamfar, Nov 2, 2013.

  1. Darjamfar

    Darjamfar

    Joined:
    Jun 4, 2012
    Posts:
    63
    Hi,
    I submitted my game to WP8 store. It failed on two counts

    -Pressing the Back button from the first screen of an application must close the application.
    -For games, when the Back button is pressed during gameplay, the game can choose to present a pause context menu or dialog or navigate the user to the prior menu screen. Pressing the Back button again while in a paused context menu or dialog closes the menu or dialog.

    Point 1, I am sure i have seen new back key press code there which doesn't appear to work. However, point two is a different matter.
    So, back key presses, how does one handle back key presses with C# script in game ?

    Thanks
    Darryl
     
  2. Hale_88

    Hale_88

    Joined:
    Aug 31, 2013
    Posts:
    14
    Hey DarJam,

    the back button is registered to the escape key, so for me I just grab a list of levels and if it's not on the first level then load the first level and if it is on the first level then exit application. Here is an example of the code

    escPressed = Input.GetKeyDown(KeyCode.Escape);

    if(escPressed == true)
    {
    if(iCurrentLevel <= 1)
    {
    Application.Quit();
    }
    else
    {
    Debug.Log("Load Another Level");
    StartCoroutine(myBlackScreen.LoadingLevel(1));
    }
    }
     
  3. Darjamfar

    Darjamfar

    Joined:
    Jun 4, 2012
    Posts:
    63
    Awesome ! Thanks Hale_88.