Пример #1
0
    private void Update()
    {
        if (state == TinterState.Hiding)
        {
            tintAlpha -= Time.deltaTime / revealTime;
            if (tintAlpha < 0)
            {
                state     = TinterState.Hidden;
                tintAlpha = 0;
            }

            Color c = img.color;
            c.a       = tintAlpha;
            img.color = c;
        }
        else if (state == TinterState.Tinting)
        {
            tintAlpha += Time.deltaTime / revealTime;
            if (tintAlpha > 1)
            {
                state     = TinterState.Tinted;
                tintAlpha = 1;
            }

            Color c = img.color;
            c.a       = tintAlpha;
            img.color = c;
        }
    }
Пример #2
0
 public void Tint()
 {
     tintAlpha = 0;
     state     = TinterState.Tinting;
 }
Пример #3
0
 public void Hide()
 {
     tintAlpha = 1;
     state     = TinterState.Hiding;
 }