Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        if (state == StatePopup.FADING)
        {
            timer -= Time.deltaTime;

            float newAlpha = Mathf.Lerp(0, 1, timer / durationFading);

            SetAlpha(newAlpha);

            if (timer < 0)
            {
                state = StatePopup.INVISIBLE;
            }
        }
        if (state == StatePopup.VISIBLE)
        {
            timer -= Time.deltaTime;

            if (timer < 0)
            {
                state = StatePopup.FADING;
                timer = durationFading;
            }
        }
    }
Esempio n. 2
0
    public void Show()
    {
        timer = durationVisible;
        state = StatePopup.VISIBLE;

        //Alpha is opaque
        SetAlpha(1f);


        AudioManager.Instance.PlaySound(noiseOnShow);
    }
Esempio n. 3
0
 public void Hide()
 {
     timer = 0f;
     state = StatePopup.INVISIBLE;
     SetAlpha(0f);
 }