Ejemplo n.º 1
0
        protected virtual void Disappear()
        {
            Color newColor = new Color(0, 0, 0, 0);

            StartCoroutine(MMFade.FadeImage(InstructionsPanel, FadeDuration, newColor));
            StartCoroutine(MMFade.FadeText(InstructionsText, FadeDuration, newColor));
            Invoke("DestroyInstructions", FadeDuration);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Fades the fader to the alpha set as parameter
 /// </summary>
 /// <param name="newColor">The color to fade to.</param>
 /// <param name="duration">Duration.</param>
 public virtual void FaderTo(Color newColor, float duration)
 {
     if (Fader == null)
     {
         return;
     }
     Fader.gameObject.SetActive(true);
     StartCoroutine(MMFade.FadeImage(Fader, duration, newColor));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Fades the dialogue box out.
        /// </summary>
        /// <param name="duration">Duration.</param>
        public virtual void FadeOut(float duration)
        {
            Color newBackgroundColor = new Color(_backgroundColor.r, _backgroundColor.g, _backgroundColor.b, 0);
            Color newTextColor       = new Color(_textColor.r, _textColor.g, _textColor.b, 0);

            StartCoroutine(MMFade.FadeImage(TextPanel, duration, newBackgroundColor));
            StartCoroutine(MMFade.FadeImage(TextPanelArrowDown, duration, newBackgroundColor));
            StartCoroutine(MMFade.FadeText(DialogueText, duration, newTextColor));
            StartCoroutine(MMFade.FadeSprite(_buttonSpriteRenderer, duration, new Color(1f, 1f, 1f, 0f)));
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Fades the fader in or out depending on the state
 /// </summary>
 /// <param name="state">If set to <c>true</c> fades the fader in, otherwise out if <c>false</c>.</param>
 public virtual void FaderOn(bool state, float duration)
 {
     if (Fader == null)
     {
         return;
     }
     Fader.gameObject.SetActive(true);
     if (state)
     {
         StartCoroutine(MMFade.FadeImage(Fader, duration, new Color(0, 0, 0, 1f)));
     }
     else
     {
         StartCoroutine(MMFade.FadeImage(Fader, duration, new Color(0, 0, 0, 0f)));
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Fades the dialogue box in.
 /// </summary>
 /// <param name="duration">Duration.</param>
 public virtual void FadeIn(float duration)
 {
     if (TextPanel != null)
     {
         StartCoroutine(MMFade.FadeImage(TextPanel, duration, _backgroundColor));
     }
     if (TextPanelArrowDown != null)
     {
         StartCoroutine(MMFade.FadeImage(TextPanelArrowDown, duration, _backgroundColor));
     }
     if (DialogueText != null)
     {
         StartCoroutine(MMFade.FadeText(DialogueText, duration, _textColor));
     }
     if (_buttonSpriteRenderer != null)
     {
         StartCoroutine(MMFade.FadeSprite(_buttonSpriteRenderer, duration, new Color(1f, 1f, 1f, 1f)));
     }
 }