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); }
//在Onenables调用(只调用一次) //开始场景每一次重新进入这个made值才会更新为false //也就是说每一次进入start场景的时候这里才会更新一次 //这从逻辑上来说是通的,可以减少生成的次数,算是优化 public void makeButtons() { if (made) { return; } if (DeathFile.isStarted == false) { DeathFile.makeAllStart(); } //清理一下,其实没有必要因为需要考虑到刷新的问题 deathButton[] theDs = theContent.GetComponentsInChildren <deathButton> (); for (int i = 0; i < theDs.Length; i++) { Destroy(theDs [i].gameObject); } //生成按钮 for (int i = 0; i < DeathFile.theDeadPlayIndex.Count; i++) { GameObject theButton = GameObject.Instantiate <GameObject> (theDButton); deathButton DB = theButton.GetComponent <deathButton> (); DB.makeStart(Convert.ToInt32(DeathFile.theDeadPlayIndex[i]), DeathFile.theDeadOpen[i], DeathFile.theDeathName[i]); theButton.transform.SetParent(theContent.transform); theButton.transform.localScale = new Vector3(1, 1, 1); } made = true; }
//---------------------------------------------------------------------------------------------------// //-------------------------------剧本树的相关操作------------------------------------------------------// //鼠标点击空白部分就意味着galgame要跳转到下一行剧本了 void moveToNextItem() { //剧本帧为空就不做操作了 if (theItemNow == null) { return; } //直接跳转的权限高于一切,虽然大多数情况下此项为空 if (theItemNow.aimPlotItemID > 0) { theDataController.loadItemForSkip(theItemNow.aimPlotItemID); return; } //如果是一个分支节点 if (theItemNow.isASpitRoot()) { //print ("这是一个分支节点,有待选择"); //进入选择界面,在这里不标明要走哪一条路线,在UI选择的时候才会真的有所选择 theChoiceController.openSelect(theItemNow.getChilds()); //可选功能,在选择的时候关闭文本框 //theTextController.shutTEXT (); } else { //如果是死亡场景,就直接进入道场 if (DeathFile.setDead(theItemNow.ThePlotItemID.ToString())) { UnityEngine.SceneManagement.SceneManager.LoadScene("DeadScene"); //进入到死亡道场 } else { //theTextController.openTEXT (); theItemNow = theItemNow.moveToNext(); //如果是回忆就需要检查一下是不是完事了 if (systemInformations.isScene && theItemNow.ThePlotItemID > systemInformations.SceneEndIndex) { UnityEngine.SceneManagement.SceneManager.LoadScene("start"); //直接返回到开始界面 } else { playTheItem(theItemNow); } } } }