コード例 #1
0
ファイル: saveButtons.cs プロジェクト: BXZR/GAL
 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("读档失败");
             }
         }
     }
 }
コード例 #2
0
ファイル: CGModeController.cs プロジェクト: BXZR/GAL
    void Start()
    {
        //最开始的界面做过这一步了,但是如果不是从start进入这个场景或者在这之前没有进入过start场景
        //就需要做这一步
        //实际上是加载
        CGModeFile.makeAllStart();

        CGNameForGroup1 = new List <string> ();
        for (int i = 0; i < CGModeFile.theCG1.Count; i++)
        {
            CGNameForGroup1.Add(CGModeFile.theCG1[i].CGFileName);
        }
        CGNameForGroup2 = new List <string> ();
        for (int i = 0; i < CGModeFile.theCG2.Count; i++)
        {
            CGNameForGroup2.Add(CGModeFile.theCG2[i].CGFileName);
        }
        CGNameForGroup3 = new List <string> ();
        for (int i = 0; i < CGModeFile.theCG3.Count; i++)
        {
            CGNameForGroup3.Add(CGModeFile.theCG3[i].CGFileName);
        }

        makeCGSelectButton(3);
    }
コード例 #3
0
 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);
 }
コード例 #4
0
ファイル: dataSystmButtons.cs プロジェクト: BXZR/GAL
 public void gameOver()
 {
     //额外的文件处理
     //既然已经完成了,就保存一下吧
     systemInformations.SaveTheOverPlot();
     CGModeFile.saveCGFile();
     SceneModeFile.saveSceneFile();
     extraHFile.saveHExtra();
     Application.Quit();
 }
コード例 #5
0
ファイル: dataSystmButtons.cs プロジェクト: BXZR/GAL
 //回到初始界面
 public void  backStartScene()
 {
     //额外的文件处理
     //既然已经完成了,就保存一下吧
     systemInformations.SaveTheOverPlot();
     CGModeFile.saveCGFile();
     SceneModeFile.saveSceneFile();
     extraHFile.saveHExtra();
     UnityEngine.SceneManagement.SceneManager.LoadScene("start");
 }
コード例 #6
0
 //创建的时候调用,用于初始化
 public void  makeStart(string pictureNameIn, Image theImageBig, CGModeController controllerIn)
 {
     pictureName   = pictureNameIn;
     theBigPicture = theImageBig;
     theController = controllerIn;
     isGet         = CGModeFile.checkIsLocked(this.pictureName);
     //按钮上面加载的都是小图
     if (isGet)
     {
         this.GetComponent <Button>().image.sprite = systemInformations.makeLoadSprite("backPictureForButton/" + pictureNameIn);
     }
 }
コード例 #7
0
ファイル: saveButtons.cs プロジェクト: BXZR/GAL
 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("回忆模式下不能快速存档");
     }
 }
コード例 #8
0
ファイル: thePlot.cs プロジェクト: BXZR/GAL
//操作剧本树单元的方法,这个程序真正用来玩的方法
//事实上,这个方法只会对单个分支节点生效
    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();
    }
コード例 #9
0
    //背景图
    void makeBackPicture(thePlotItem theItem)
    {
        if (string.IsNullOrEmpty(theItem.theBackPictureName))
        {
            //显示默认背景图,没有不行啊
            //这也是显示出来的第一张的图了
            theBackPicture.sprite = systemInformations.makeLoadSprite("backPicture/home");
            theBackName           = "home";
        }
        else
        {
            //只有指定换图的时候才会换图
            if (string.IsNullOrEmpty(theItem.theBackPictureName) == false && theItem.theBackPictureName.Equals(theBackName) == false)
            {
                //print ("back picture change");
                theBackName = theItem.theBackPictureName;

                if (theBackName != "changeBack")
                {
                    //print ("change the back");

                    //CG 控制
                    CGModeFile.CGActive(theBackName + "_Button");                   //激活这个CG
                    theBackPicture.sprite = systemInformations.makeLoadSprite("backPicture/" + theBackName);
                }
                else
                {
                    //这个转换是一个非常细节的转换,需要保证转换的时间要比下一个剧本帧的转换时间短,要不然会出现图片转换会出现问题
                    Invoke("waitChangeInvoke", theItem.waitTimeForAutoSkip * 0.5f / Time.timeScale);
                    if (theForwardPicture && theForwardPicture.gameObject.activeInHierarchy)
                    {
                        theForwardPicture.makeChange(theItem.waitTimeForAutoSkip * 1.6f);
                    }
                }
            }
        }
    }