Пример #1
0
        private IEnumerator DialogueIn()
        {
            // Based on the transition, Set the start variables.
            InitDialogue();
            // IF we want to fade in the dialogue,
            // ELSE IF we want to grow the dialogue,
            // ELSE IF we want to instantly show the dialogue.
            if (isFadeDialogue)
            {
                // Fade in image.
                StartCoroutine(GUI_Helper.FadeImage(dialogueComponent.dialogueImage, fadeTime, 0f, dialogueComponent.GetInitialDialogueUIAlpha()));
                // IF we have fading text as well.
                if (fadeText)
                {
                    // Switch to the new text.
                    dialogueComponent.SwitchText(dialogue[dialogueIndex]);
                    // Fade in text.
                    StartCoroutine(GUI_Helper.FadeText(dialogueComponent.dialogueText, textFadeTime, 0f, dialogueComponent.GetInitialDialogueTextAlpha()));
                    // Wait for the longer time of the dialogue fade or the dialogue fade text time.
                    yield return(new WaitForSeconds(Mathf.Max(fadeTime, textFadeTime)));

                    yield break;
                }
                // Wait for the length of the Dialogue Box fade.
                yield return(new WaitForSeconds(fadeTime));
            }
            else if (isGrowShrinkDialogue)
            {
                // Grow the dialogue.
                yield return(StartCoroutine(GUI_Helper.GrowShrinkImage(dialogueComponent.dialogueImage, growShrinkTime, dialogueComponent.dialogueImage.transform.localScale.x, dialogueComponent.dialogueImage.transform.localScale.y, dialogueComponent.GetInitialDialogueScale().x, dialogueComponent.GetInitialDialogueScale().y)));
            }
            else if (isInstantDialogue)
            {
                // No Coroutines needed but leaving this here incase you want to implement something.
            }

            // Switch to the new text.
            dialogueComponent.SwitchText(dialogue[dialogueIndex]);
            // IF we want to fade the text,
            // ELSE IF we want the text to be typed out,
            // ELSE IF we want the text to be displayed instantly.
            if (fadeText)
            {
                // Start the fade on the text.
                yield return(StartCoroutine(GUI_Helper.FadeText(dialogueComponent.dialogueText, textFadeTime, 0f, dialogueComponent.GetInitialDialogueTextAlpha())));
            }
            else if (typedText)
            {
                // Dont move forward until the typing of the text is finished.
                yield return(StartCoroutine(GUI_Helper.TypeText(dialogueComponent.dialogueText, dialogueTextPause, dialogue[dialogueIndex], typeSound)));
            }
            else if (instantText)
            {
                // No Coroutine needed but leaving this here incase you want to implement something.
            }
        }
Пример #2
0
 private IEnumerator DialogueTextOut()
 {
     // IF we want the dialogue to fade,
     // ELSE IF we have the typed text OR instant text to transition out.
     if (fadeText)
     {
         // We fade the text.
         yield return(StartCoroutine(GUI_Helper.FadeText(dialogueComponent.dialogueText, textFadeTime, dialogueComponent.dialogueText.color.a, 0f)));
     }
     else if (typedText)
     {
         // No Coroutine needed but leaving this here incase you want to implement something.
     }
     else if (instantText)
     {
         // No Coroutine needed but leaving this here incase you want to implement something.
     }
     // Switch to a blank.
     dialogueComponent.SwitchText("");
 }
Пример #3
0
 private IEnumerator DialogueTextIn()
 {
     // Switch the dialogue text.
     dialogueComponent.SwitchText(dialogue[dialogueIndex]);
     // IF we want to fade the text,
     // ELSE IF we want the text to be typed out,
     // ELSE IF we want the text to appear instantly.
     if (fadeText)
     {
         yield return(StartCoroutine(GUI_Helper.FadeText(dialogueComponent.dialogueText, textFadeTime, 0f, dialogueComponent.GetInitialDialogueTextAlpha())));
     }
     else if (typedText)
     {
         // Dont move forward until the typing of the text is finished.
         yield return(StartCoroutine(GUI_Helper.TypeText(dialogueComponent.dialogueText, dialogueTextPause, dialogue[dialogueIndex], typeSound)));
     }
     else if (instantText)
     {
         // No Coroutine needed but leaving this here incase you want to implement something.
     }
 }
Пример #4
0
 private IEnumerator DialogueOut()
 {
     // IF we want the dialogue to fade,
     // ELSE IF we want to shrink the dialogue,
     // ELSE IF we want the dialogue to disappear instantly.
     if (isFadeDialogue)
     {
         // Fade out the dialogue.
         StartCoroutine(GUI_Helper.FadeImage(dialogueComponent.dialogueImage, fadeTime, dialogueComponent.dialogueImage.color.a, 0f));
         // We fade the text.
         yield return(StartCoroutine(GUI_Helper.FadeText(dialogueComponent.dialogueText, fadeTime, dialogueComponent.dialogueText.color.a, 0f)));
     }
     else if (isGrowShrinkDialogue)
     {
         // Shrink the dialogue.
         yield return(StartCoroutine(GUI_Helper.GrowShrinkImage(dialogueComponent.dialogueImage, growShrinkTime, dialogueComponent.dialogueImage.transform.localScale.x, dialogueComponent.dialogueImage.transform.localScale.y, 0f, 0f)));
     }
     else if (isInstantDialogue)
     {
         // No Coroutine needed but leaving this here incase you want to implement something.
     }
     // Switch to a blank text.
     dialogueComponent.SwitchText("");
 }