public static void CancelQuit ();

Descripción

Cancela la salida de la aplicación. Esto es útil para mostrar una pantalla de despedida al final del juego.

This function only works in the player. IMPORTANT: This function has no effect on iPhone. Application can not prevent termination under iPhone OS.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public float showSplashTimeout = 2.0F; private bool allowQuitting = false; void Awake() { DontDestroyOnLoad(.gameObject); } void OnApplicationQuit() { if (Application.loadedLevelName.ToLower() != "finalsplash") StartCoroutine("DelayedQuit"); if (!allowQuitting) Application.CancelQuit(); } IEnumerator DelayedQuit() { Application.LoadLevel("finalsplash"); yield return new WaitForSeconds(showSplashTimeout); allowQuitting = true; Application.Quit(); } }