//Wait for the specified time and then exit. (For calling "OnExit()") //Ignore WebGL etc. (Since we only have to close the browser) //指定時間待機してから終了。エディタの場合はプレイモードの終了。(※OnExit() から呼び出し用) //WebGL等は無視(ブラウザを閉じるしかないので) protected override IEnumerator WaitAndExit(float sec) { if (OnBeforeDelay != null) { OnBeforeDelay.Invoke(); } yield return(new WaitForSeconds(sec)); if (OnBeforeExit != null) { OnBeforeExit.Invoke(); } #if UNITY_ANDROID && !UNITY_EDITOR AndroidPlugin.CancelToast(); //(*) Since the Toast tends to remain long on the screen, it disappears here. //トーストが画面に長く残る傾向があるので、ここで消す #endif #if UNITY_EDITOR UnityEditor.EditorApplication.isPlaying = false; //For Editor //Editorではプレイを停止 #elif !UNITY_WEBGL && !UNITY_WEBPLAYER Application.Quit(); #endif done = true; }
//Interrupt display of Android Toast public void CancelToast() { #if UNITY_EDITOR Debug.Log("CancelToast called"); #elif UNITY_ANDROID AndroidPlugin.CancelToast(); #endif }