Пример #1
0
 private void Play()
 {
     if (nowTime == 0.0f)
     {
         GetComponent <Text>().text  = StoryLineText.storyLine[nowIndex];
         PlayerController.canControl = false;
     }
     nowTime += Time.deltaTime;
     if (nowTime >= StoryLineText.interval[nowIndex])
     {
         nowTime = 0.0f;
         PlayerController.canControl = true;
         nowIndex++;
         if (StoryLineText.IsTaskPoint(nowIndex - 1))
         {
             //完成任务
             TaskText.GetComponent <Task>().enabled = true;
             gameObject.SetActive(false);
         }
         //是否是剧情停止的点
         if (StoryLineText.IsPausePoint(nowIndex - 1))
         {
             gameObject.SetActive(false);
         }
     }
 }
Пример #2
0
 void Update()
 {
     transform.GetChild(0).GetComponent <Text>().text = asideText[nowIndex];
     nowTime += Time.deltaTime;
     PlayerController.canControl = false;
     if (nowTime >= 3.0f && Dialogue.nowIndex != 76)
     {
         nowTime = 0.0f;
         nowIndex++;
         PlayerController.canControl = true;
         if (!StoryLineText.IsPausePoint(Dialogue.nowIndex - 1))
         {
             MyObject.SetObjectActive("Canvas/Dialogue");
         }
         if (!IsContinue(nowIndex))
         {
             gameObject.SetActive(false);
         }
         if (nowIndex == 14)
         {
             SceneManager.LoadScene("StartScene");
         }
     }
 }