Exemplo n.º 1
0
    private IEnumerator Blink_Imp(Text text)
    {
        // :: Get
        text.gameObject.SetActive(true);
        Color baseColor = text.color;

        // :: Loop
        Enum.eFade eFade = Enum.eFade.OUT;
        while (true)
        {
            if (eFade == Enum.eFade.OUT)
            {
                for (float opacity = 0f; opacity <= 1f; opacity += Time.deltaTime)
                {
                    text.color =
                        new Color(baseColor.r, baseColor.g, baseColor.b, opacity);

                    yield return(null);
                }
                eFade = Enum.eFade.IN;
            }
            else if (eFade == Enum.eFade.IN)
            {
                for (float opacity = 1f; 0 <= opacity; opacity -= Time.deltaTime)
                {
                    text.color =
                        new Color(baseColor.r, baseColor.g, baseColor.b, opacity);

                    yield return(null);
                }
                eFade = Enum.eFade.OUT;
            }
        }
    }
Exemplo n.º 2
0
 // : Fade
 public void FadeDim(Enum.eFade eFade, System.Action action = null)
 {
     if (eFade == Enum.eFade.IN)
     {
         this.FADEMachine.FadeIn(this.IMAGE_Dim, action);
     }
     else if (eFade == Enum.eFade.OUT)
     {
         this.FADEMachine.FadeOut(this.IMAGE_Dim, action);
     }
 }