예제 #1
0
 void OnTriggerEnter2D(Collider2D c)
 {
     if (c.tag == "Player")
     {
         Debug.Log("enter");
         msgSys.Next();
         triggerd = true;
     }
 }
예제 #2
0
 public void RunText()
 {
     if (!Istalking)
     {
         ReadTextDataFromAsset(textAsset);
         Istalking = true;
         Panel.SetActive(true);
     }
     //Continue the messages, stoping by [w] or [lr] keywords.
     msgSys.Next();
 }
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.S))
        {
            //You can sending the messages from strings or text-based files.
            if (msgSys.IsCompleted)
            {
                msgSys.SetText("Send the messages![lr] HelloWorld![w]");
            }
        }

        if (Input.GetKeyDown(KeyCode.Space))
        {
            //Continue the messages, stoping by [w] or [lr] keywords.
            msgSys.Next();
        }

        //If the message is complete, stop updating text.
        if (msgSys.IsCompleted == false)
        {
            uiText.text = msgSys.text;
        }

        //Auto update from textList.
        if (msgSys.IsCompleted == true && textIndex < textList.Count)
        {
            msgSys.SetText(textList[textIndex]);
            textIndex++;
        }
    }
예제 #4
0
    void Update()
    {
        //You can sending the messages from strings or text-based files.
        // if (msgSys.IsCompleted)  // 如果IsCompleted跑完
        //    {
        //  NPC.isTalk = false;
        //  }
        //If the message is complete, stop updating text.
        if (msgSys.IsCompleted == false)     //文字沒有跑完
        {
            if (Input.GetKeyDown(KeyCode.Z))
            {
                //Continue the messages, stoping by [w] or [lr] keywords.
                msgSys.Next();
                //  msgSys.textSpeed -= 0.099f;
            }

            /*  if (Input.GetKeyUp(KeyCode.Z))
             * {
             *    msgSys.textSpeed = 0.1f;
             *
             * } */
            uiText.text = msgSys.text;
        }

        //Auto update from textList.
        //Debug.Log(msgSys.IsCompleted);
        //Debug.Log("3 - " + textIndex + " "+textList.Count);

        if (msgSys.IsCompleted == true && textIndex < textList.Count)      //確認文字跑完跟textindex 0 比文字數少時。
        {
            msgSys.SetText(textList[textIndex]);
            textIndex++;
        }
    }