示例#1
0
    public void ProgressConversation()
    {
        if (!textTyper.IsTyping && convoPacket.lineNum <= convoPacket.line.Count - 1)
        {
            if (convoPacket.lineNum == 0)
            {
                ConversationBox.SetActive(true);
            }
            endTextBox.SetActive(false);

            textTyper.TypeText(convoPacket.line[convoPacket.lineNum].speech, 0.02f);
            talkerName.text = convoPacket.line[convoPacket.lineNum].talker;
            convoPacket.lineNum++;
        }
        else
        {
            if (textTyper.IsTyping)
            {
                textTyper.Skip();
            }
            else if (convoPacket.lineNum > convoPacket.line.Count - 1)
            {
                conversationText.text = string.Empty;
                talkerName.text       = string.Empty;
                ConversationBox.SetActive(false);
                endTextBox.SetActive(false);

                FinishedConversation();
            }
        }
    }
示例#2
0
 void SkipText()
 {
     if (dialogTyper && dialogTyper.IsSkippable())
     {
         dialogTyper.Skip();
     }
 }
示例#3
0
    public IEnumerator ShowText()
    {
        while (_story.canContinue)
        {
            string str = _story.Continue();
            this.printCompleted = false;

            typer.TypeText(str, 0.04f);

            // typing ends when player tries to skip it, or if the print was completed naturally
            yield return(new WaitForEndOfFrame());

            yield return(new WaitUntil(() => this.dialogKeyPressed || this.printCompleted));

            this.dialogKeyPressed = false;

            typer.Skip();

            // end this line after player confirmation
            yield return(new WaitForEndOfFrame());

            yield return(new WaitUntil(() => this.dialogKeyPressed));

            this.dialogKeyPressed = false;
        }
    }
示例#4
0
文件: TextPlayer.cs 项目: zillix/LD46
 public void Skip()
 {
     if (currentText != null && currentText.skippable)
     {
         typer.Skip();
     }
 }
示例#5
0
 private void HandlePrintNextClicked()
 {
     if (testTextTyper.IsSkippable() && testTextTyper.IsTyping)
     {
         testTextTyper.Skip();
     }
     else
     {
         //ShowScript();
         GameManager.Instance.StartTutorialRound();
     }
 }
示例#6
0
    IEnumerator Text()
    {
        container.SetActive(true);
        if (animator)
        {
            animator.SetBool("active", true);
        }

        while (_story.canContinue)
        {
            string str = _story.Continue();
            this.printCompleted = false;

            // start typing
            typer.TypeText(str, 0.02f);
            if (animator)
            {
                animator.SetBool("idle", false);
            }

            // typing ends when player tries to skip it, or if the print was completed naturally
            yield return(new WaitForEndOfFrame());

            yield return(new WaitUntil(() => this.dialogKeyPressed || this.printCompleted));

            this.dialogKeyPressed = false;

            typer.Skip();
            if (animator)
            {
                animator.SetBool("idle", true);
            }

            // end this line after player confirmation
            yield return(new WaitForEndOfFrame());

            yield return(new WaitUntil(() => this.dialogKeyPressed));

            this.dialogKeyPressed = false;
        }

        if (animator)
        {
            animator.SetBool("active", false);
        }
        container.SetActive(false);

        savedJson           = _story.state.ToJson();
        this.printCompleted = false;
        this.currDialog     = null;
        Toggle(false);
    }
示例#7
0
    /// <summary>
    /// Grab entity dialogue and display it to the UI canvas as dialogue.
    /// </summary>
    /// <param name="entity">The activating entity.</param>
    public void Talk(Entity entity)
    {
        if (entity.currentChain.dialogueOptions != null && !choosing)
        {
            // Check if the dialogue is currently typing. If it is, skip the typing. If not, get new dialogue.
            if (!content.IsTyping)
            {
                // If the current chain is empty, get the next chain
                if (entity.currentChain.dialogueOptions.Count.Equals(0))
                {
                    entity.currentChain = GetDialogueChain(entity);
                }

                // Display dialogue on screen
                DisplayDialogue(GetDialogueValuesFromChain(entity));
            }
            else
            {
                // Skip typing of dialogue and display the whole thing
                content.Skip();
            }
        }
    }
示例#8
0
 public void Finish()
 {
     _typer.Skip();
 }
示例#9
0
 public void SkipTextTyping(string stringe)
 {
     textTyper.Skip();
     // Debug.Log(stringe);
 }
示例#10
0
 public void SkipCurrent()
 {
     m_textController?.Skip();
     m_textControllerUGUI?.SkipTypeText();
 }