示例#1
0
    private void Update()
    {
        if ((Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButtonDown(0)) && inDialogue && dialogueFinished)
        {
            charScript.SetCharacterValsInUI(currentDialogue.conversation[dialogueIndex].character);
            if (canExit)
            {
                Sequence s = DOTween.Sequence();
                s.AppendInterval(.8f);
                onDialogueEnd.Invoke();
            }

            if (nextDialogue)
            {
                if (currentDialogue.conversation[dialogueIndex].dialogue == null)
                {
                    dialogueFinished = true;
                }
                else
                {
                    animatedText.ReadText(currentDialogue.conversation[dialogueIndex].dialogue);
                    dialogueFinished = false;
                }
            }
        }
        else if ((Input.GetKey(KeyCode.Space) || Input.GetMouseButtonDown(0)) && inDialogue && !dialogueFinished)
        {
            SkipDialogue();
        }
    }
示例#2
0
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space) && inDialogue)
        {
            if (canExit)
            {
                CameraChange(false);
                FadeUI(false, .2f, 0);
                Sequence s = DOTween.Sequence();
                s.AppendInterval(.8f);
                s.AppendCallback(() => ResetState());
            }

            if (nextDialogue)
            {
                animatedText.ReadText(currentVillager.dialogue.conversationBlock[dialogueIndex]);
            }
        }
    }
示例#3
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space) && inDialogue)
     {
         if (animatedText.isReadingDialogue)
         {
             animatedText.isReadingDialogue = false;
         }
         else if (canExit)
         {
             CloseDialogue();
         }
         else if (nextDialogue)
         {
             animatedText.ReadText(currentDialogue.conversationBlock[dialogueIndex]);
         }
     }
     HandleTimer();
 }
示例#4
0
    public void DisplayNextSentence()
    {
        if (sentences.Count == 0)
        {
            EndDialogue();
            return;
        }

        string sentence = sentences.Dequeue();

        dialogue.ReadText(sentence);
    }
    private void FadeUI(bool show, float time, float delay)
    {
        Sequence s = DOTween.Sequence();

        // DOTween에서 delay만큼 기다림
        s.AppendInterval(delay);
        // delay 초 뒤, canvasGroup을 DOFade 함
        s.Append(canvasGroup.DOFade(show ? 1 : 0, time));

        // 시민과 대화가 시작할 경우, 대화 초기화 진행
        if (show)
        {
            dialogueIndex = 0;
            s.Join(canvasGroup.transform.DOScale(0, time * 2).From().SetEase(Ease.OutBack));
            s.AppendCallback(() => animatedText.ReadText(currentVillager.dialogue.conversationBlock[0]));
        }
    }
示例#6
0
    //call this method to read the next line of dialogue
    private void LoadNextStoryLine()
    {
        //turns off the indicator to be invisible
        endedIndicator.SetActive(false);

        //if there is another line to display
        if (story.canContinue)
        {
            //get ned
            string line = story.Continue();

            text.ReadText(line);
        }
        else
        //no more lines to display, end dialogue
        {
            EndDialogue();
        }
    }
示例#7
0
 // Start is called before the first frame update
 void Start()
 {
     tMP = GetComponent <TMP_Animated>();
     tMP.ReadText("TESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTESTTEST");
 }
示例#8
0
 public void TutorialStart()
 {
     num = 0;
     CineGroup.AddMember(Teacher.transform, 0.2f, 0);
     DialogueBubble.transform.DOScale(new Vector3(1, 1, 1), 0.5f);
     textMesh.ReadText("Come here!");
 }
 void updateText(string text)
 {
     textComponent.ReadText(text);
     arrow.SetActive(true);
 }