IEnumerator HandleSaveingGame() { //save game SaveAndLoading.GetInstance().SaveGameProcess(); //wait for 0.5 second until game is saved yield return(new WaitForSeconds(GlobalParameter.INTERVAL_TIME_0DOT5)); }
/// <summary> /// 处理退出游戏前的必要操作 /// </summary> /// <returns></returns> IEnumerator HandleSavingGame() { bool boolResult = SaveAndLoading.GetInstance().SaveGameProcess(); yield return(new WaitForSeconds(1f)); //yield return boolResult; Application.Quit(); }
IEnumerator EnterNextScene_Continue() { //读取游戏进度,游戏全局参数读取 SaveAndLoading.GetInstance().LoadingGame_GlobalParameter(); //场景淡出(场景变暗) FadeInAndOut.Instance.SetSceneToBlack(); yield return(new WaitForSeconds(1.5f)); //调用父类的方法,简化代码 base.EnterNextScene(GlobalParaMgr.NextSceneName); //base.EnterNextScene(SceneEnum.MajorCity); }
//load saved game IEnumerator ContinueGame() { //load save game data SaveAndLoading.GetInstance().LoadingGame_GlobalParameter(); //Scene fades out FadeInAndOut.Instance.SetScenesToBlack(); //fade out yield return(new WaitForSeconds(3.0f)); //load scenes base.EnterNextScenes(GlobalParaMgr.NextScenesName); }
public AudioClip AcBackground; //major ciry background music IEnumerable Start() { if (AcBackground != null) { AudioManager.PlayBackground(AcBackground); } //load player saved data if (GlobalParaMgr.CurGameType == CurrentGameType.Continue) { //load game yield return(new WaitForSeconds(2)); SaveAndLoading.GetInstance().loadingGame_PlayerData(); } }
public AudioClip Auc_Background; //主城背景音乐 IEnumerator Start() { //播放背景音乐 if (Auc_Background != null) { AudioManager.PlayBackground(Auc_Background); } //+++新加的功能+++ //读取单机玩家数据进度 if (GlobalParaMgr.CurGameStatus == GameStatus.Continue) { //读取进度 yield return(new WaitForSeconds(2f)); SaveAndLoading.GetInstance().LoadingGame_PlayerData(); } }