Skip to content

Instantly share code, notes, and snippets.

@naspapa
Last active March 7, 2017 05:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naspapa/4d6182a84c98365f94e64003cc18c2eb to your computer and use it in GitHub Desktop.
Save naspapa/4d6182a84c98365f94e64003cc18c2eb to your computer and use it in GitHub Desktop.
dialog
void Update()
{
if (Application.platform == RuntimePlatform.Android)
{
// エスケープキー取得
if (Input.GetKeyDown(KeyCode.Escape))
{
//ダイアログ開く
dialogOpen();
}
}
}
void dialogOpen()
{
      //ラベルをセット
      DialogManager.Instance.SetLabel("Yes", "No", "Close");
// YES NO ダイアログ
DialogManager.Instance.ShowSelectDialog(
"アプリを終了しますか?",
(bool result) => {
Debug.Log("result:" + result.ToString());
              //Yesを押したら終了
              if(result)
Application.Quit();
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment