Example #1
0
 private void HandleDialogueText(IntroDialogue currentDialogue)
 {
     contentText.color = new Color(contentText.color.r, contentText.color.g, contentText.color.b, 1f);
     if (previousDialogue != null && previousDialogue.isFadedOut)
     {
         if (currentDialogue.isFadedIn)
         {
             HandleFadedOutDialogue(currentDialogue.content, previousDialogue.fadedOutDuration, currentDialogue.fadedInDuration);
         }
         else
         {
             HandleFadedOutDialogue(currentDialogue.content, previousDialogue.fadedOutDuration);
         }
     }
     else
     {
         if (!currentDialogue.isFadedIn)
         {
             ShowNormalDialogue(currentDialogue.content);
         }
         else
         {
             ShowFadedInDialogue(currentDialogue.content, currentDialogue.fadedInDuration);
         }
     }
 }
Example #2
0
 private void HandleDialogueSFX(IntroDialogue currentDialogue)
 {
     if (audioSource.isPlaying)
     {
         audioSource.Stop();
     }
     if (currentDialogue.SFX != null)
     {
         audioSource.PlayOneShot(currentDialogue.SFX.clip, currentDialogue.SFX.volume);
     }
 }
Example #3
0
        private void HandleDialogue()
        {
            //Handle Fading In text transistion
            if (isFadingIn)
            {
                if (fadeInCoroutine != null)
                {
                    StopCoroutine(fadeInCoroutine);
                    fadeInCoroutine = null;
                }
                isFadingIn = false;
                ShowNormalDialogue(previousDialogue.content);
                return;
            }
            //Handle Fading Out text transistion
            if (isFadingOut)
            {
                if (introFadeCoroutine != null)
                {
                    StopCoroutine(introFadeCoroutine);
                    introFadeCoroutine = null;
                }

                if (fadeOutCoroutine != null)
                {
                    StopCoroutine(fadeOutCoroutine);
                    fadeOutCoroutine = null;
                }

                isFadingOut = false;
                if (previousDialogue.isFadedIn)
                {
                    ShowFadedInDialogue(previousDialogue.content, previousDialogue.fadedInDuration);
                }
                else
                {
                    ShowNormalDialogue(previousDialogue.content);
                }
                return;
            }

            //Handle completed text transistion
            IntroDialogue currentDialogue = dialogueQueue.Peek();

            HandleDialogueText(currentDialogue);
            HandleDialogueBGM(currentDialogue);
            HandleDialogueSFX(currentDialogue);

            previousDialogue = dialogueQueue.Dequeue();
        }
Example #4
0
 private void HandleDialogueBGM(IntroDialogue currentDialogue)
 {
     if (currentDialogue.bgm != null)
     {
         Debug.Log(bgmAudioSource.isPlaying);
         if (bgmAudioSource.isPlaying)
         {
             if (currentDialogue.startOverBGM)
             {
                 PlayBGM(currentDialogue.bgm);
             }
         }
         else
         {
             PlayBGM(currentDialogue.bgm);
         }
     }
 }