IEnumerator OnApplicationPause(bool paused) { if (paused && SceneManager.GetActiveScene().buildIndex != 0) { PersistentEngine.SaveState(); } else { } yield return(null); }