コード例 #1
0
    private void Awake()
    {
        messageT = transform.Find("message").Find("messageT").GetComponent <Text>();
        talking  = transform.Find("Voice").GetComponent <AudioSource>();

        transform.Find("message").GetComponent <Button_UI>().ClickFunc = () =>
        {
            if (tws != null && tws.IsActive())
            {
                tws.WriteAndDestroy();
            }
            else
            {
                if (i <= 12)
                {
                    message = messageArray[i];
                    StartTalkingSound();
                    tws = TextWriting.AddWritingStatic(messageT, message, .05f, true, true, StopTalkingSound);

                    i += 1;
                }
                else
                {
                    float seconds = .4f;
                    StartCoroutine(_wait(seconds));
                    //test();
                }
            }
        };
    }
コード例 #2
0
    IEnumerator _wait(float time)
    {
        message = messageArray[i];
        StartTalkingSound();
        tws = TextWriting.AddWritingStatic(messageT, message, .05f, true, true, StopTalkingSound);
        yield return(new WaitForSeconds(time));

        SceneManager.LoadScene("MainMenu");
    }
コード例 #3
0
ファイル: TextWriting.cs プロジェクト: hyerui/20T2-GAD180
 public void writeAllAndDestroy()
 {
     uiText.text    = toBeWritten;
     characterIndex = toBeWritten.Length;
     if (onComplete != null)
     {
         onComplete();
     }
     TextWriting.RemoveWriter_Static(uiText);
 }
コード例 #4
0
ファイル: TextWriting.cs プロジェクト: miwe95/Babyelephant
 public void WriteAndDestroy()
 {
     uiText.text = textWrite;
     charidx     = textWrite.Length;
     if (onComplete != null)
     {
         onComplete();
     }
     TextWriting.RemoveWriter_Static(uiText);
 }
コード例 #5
0
 // Start is called before the first frame update
 void Awake()
 {
     buttonui.ClickFunc = () =>
     {
         if (textWriterSingle != null && textWriterSingle.isActive())
         {
             textWriterSingle.writeAllAndDestroy();
         }
         else
         {
             string[] messageArray = new string[]
             {
                 "The vague mumbling of voices reach their ears, some loud," +
                 "some soft. But utterly indiscernable",
                 "Screaming flashes of red. Followed by seemingly unending darkness",
                 "Dull thuds rocked their body, jolting them about",
                 "Sights. Souunds. Feelings. All melded into a mindless swirl. Unidentifiable among" +
                 " the mist of senses",
             };
             string message = messageArray[messageNum];
             textWriterSingle = TextWriting.TextWriter_Static(messageText, message, 0.05f, true, true, NextLine);
         }
     };
 }
コード例 #6
0
ファイル: TextWriting.cs プロジェクト: hyerui/20T2-GAD180
 public void Awake()
 {
     instance             = this;
     textWriterSingleList = new List <TextWriterSingle>();
 }
コード例 #7
0
ファイル: TextWriting.cs プロジェクト: miwe95/Babyelephant
 private void Awake()
 {
     inst    = this;
     twsList = new List <TextWritingSingle>();
 }
コード例 #8
0
 private void Start()
 {
     StartTalkingSound();
     tws = TextWriting.AddWritingStatic(messageT, "Hello Folks! \n" + "Just click somewhere inside the bubble to continue …", .05f, true, true, StopTalkingSound);
 }