public void makeSaveOrLoad() { if (systemInformations.isScene) { informationPanel.showInformation("回忆模式不能存档或者读档"); } else { if (systemInformations.isSaving) { theDataController.saveItem(thePlotController.TheItemNow, saveIndex); savePicture(); StartCoroutine(loadPicture()); //额外的文件处理 systemInformations.SaveTheOverPlot(); CGModeFile.saveCGFile(); SceneModeFile.saveSceneFile(); extraHFile.saveHExtra(); informationPanel.showInformation("存档"); } else { if (theDataController.loadItem(saveIndex)) { informationPanel.showInformation("读档成功"); } else { informationPanel.showInformation("读档失败"); } } } }
void makeStart() { theAudioGetter.playerSource(); //DarkStarter.gameObject.SetActive (false); //这里有一个渐变的效果,这个原先是是一个直接关闭 //花上两秒的时间渐入时间有一点长了 DarkStarter.GetComponent <effectSlowIn>().makeChangeOut(1.25f); UIUseRoot.gameObject.SetActive(true); theStartSceneEffect.SetActive(true); //没有必要做这一步,当然求稳健的话是可以的 //theAudioSource.gameObject.SetActive (true); theAudioSource.Play(); theAudioSource.loop = true; if (!isStarted) { //以下功能关乎文件,但是很多东西都被保存在了静态变量中 //所以从文件进行初始化的功能只在最开始的时候做一次就可以了 configController.createConfigFileIfNull(); //如果没有配置文件就建立默认的配置文件 SceneModeFile.InitValues(); CGModeFile.makeAllStart(); //生成CG文件 DeathFile.makeAllStart(); systemInformations.makeOlotOverAllCount(); //获得总剧本长度 systemInformations.LoadPlotOver(); extraHFile.makeAllStart(); //额外特典标记 } systemInformations.flash(); //默认回到初始界面时间scale变回原状 isStarted = true; isStartedThisTurn = true; Invoke("trueStart", 1.5f); }
void Start() { //最开始的界面做过这一步了,但是如果不是从start进入这个场景或者在这之前没有进入过start场景 //就需要做这一步 SceneModeFile.InitValues(); makeStart(); changeSceneButton(3); }
public void gameOver() { //额外的文件处理 //既然已经完成了,就保存一下吧 systemInformations.SaveTheOverPlot(); CGModeFile.saveCGFile(); SceneModeFile.saveSceneFile(); extraHFile.saveHExtra(); Application.Quit(); }
//回到初始界面 public void backStartScene() { //额外的文件处理 //既然已经完成了,就保存一下吧 systemInformations.SaveTheOverPlot(); CGModeFile.saveCGFile(); SceneModeFile.saveSceneFile(); extraHFile.saveHExtra(); UnityEngine.SceneManagement.SceneManager.LoadScene("start"); }
public void quickSave() { if (systemInformations.isScene == false) { theDataController.saveItem(thePlotController.TheItemNow, saveIndex); savePicture(); StartCoroutine(loadPicture()); //额外的文件处理 systemInformations.SaveTheOverPlot(); CGModeFile.saveCGFile(); SceneModeFile.saveSceneFile(); extraHFile.saveHExtra(); informationPanel.showInformation("存档"); } else { informationPanel.showInformation("回忆模式下不能快速存档"); } }
//操作剧本树单元的方法,这个程序真正用来玩的方法 //事实上,这个方法只会对单个分支节点生效 public void playTheItem(thePlotItem theItem = null) { //简单的防护措施 if (theItem == null) { //额外的文件处理 //既然已经完成了,就保存一下吧 systemInformations.SaveTheOverPlot(); CGModeFile.saveCGFile(); SceneModeFile.saveSceneFile(); extraHFile.saveHExtra(); //print ("没有可控制的剧本元素"); SceneManager.LoadScene("start"); return; } //尝试激活Scene //规则是当一个剧本帧的下标到达了某一个scene的最后一个下标,那么这个scerne就可以被解锁 SceneModeFile.activeScene(theItem.ThePlotItemID); //每一次新跑一个剧本帧的时候才会真的初始化这个剧本帧的儿子节点 //性能消耗均摊,这样看上去要比初始化的时候气归初始化要好一点 theItem.makeStart(); theItemNow = theItem; watiForSkipTimer = theItemNow.waitTimeForAutoSkip; //各种控制单元对这个单元的操作 theTextController.setTheString(theItem); theUIController.makeShow(theItem); //print ("theMusicController name is " + theMusicController.gameObject.name); theMusicController.playBackMusic(theItem); theSoundController.playSound(theItem); thePeopleSoundController.playSound(theItem, true); //剧本帧完成之后这些计算才能生效 //剧本完成度控制 systemInformations.addPlotOverPercent(theItem); //好感度控制 theItem.makeAddLoveValue(); }