Exemple #1
0
 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("读档失败");
             }
         }
     }
 }
Exemple #2
0
 public void gameOver()
 {
     //额外的文件处理
     //既然已经完成了,就保存一下吧
     systemInformations.SaveTheOverPlot();
     CGModeFile.saveCGFile();
     SceneModeFile.saveSceneFile();
     extraHFile.saveHExtra();
     Application.Quit();
 }
Exemple #3
0
 //回到初始界面
 public void  backStartScene()
 {
     //额外的文件处理
     //既然已经完成了,就保存一下吧
     systemInformations.SaveTheOverPlot();
     CGModeFile.saveCGFile();
     SceneModeFile.saveSceneFile();
     extraHFile.saveHExtra();
     UnityEngine.SceneManagement.SceneManager.LoadScene("start");
 }
Exemple #4
0
 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("回忆模式下不能快速存档");
     }
 }
Exemple #5
0
//操作剧本树单元的方法,这个程序真正用来玩的方法
//事实上,这个方法只会对单个分支节点生效
    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();
    }