Last active
March 7, 2017 05:16
-
-
Save naspapa/4d6182a84c98365f94e64003cc18c2eb to your computer and use it in GitHub Desktop.
dialog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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