Beispiel #1
0
    IEnumerator PopupAction(bool IsBonus)
    {
        bool AllSkin = skinManager.CheckAllGetProgressSkins();

        if (IsBonus || AllSkin)
        {
            Boxparent.SetActive(false);
            CoinImg.SetActive(true);
            Buttons.SetActive(true);
            Invoke("ButtonsDelay", 3);
        }
        else
        {
            Boxparent.SetActive(true);
            CoinImg.SetActive(false);

            float Progress = progressManager.ProgressUp();
            if (Progress == 100)
            {
                Buttons.SetActive(false);
            }
            else
            {
                Buttons.SetActive(true);
                Invoke("ButtonsDelay", 3);
            }

            SkinGaugeText.text = string.Format("{0:0}%", double.Parse(Progress.ToString()));
            yield return(new WaitForSeconds(0.5f));

            SoundManager.Instance.Play("Gauge");
            Box.DOFillAmount(Progress / 100, 0.8f).OnComplete(() =>
            {
                if (Box.fillAmount == 1f)
                {
                    boxAni.gameObject.SetActive(true);
                    Boxparent.SetActive(false);
                    Box.fillAmount = 0f;
                    boxAni.enabled = true;
                    SoundManager.Instance.Play("chest_open");
                    boxAni.AnimationState.SetAnimation(0, "open", false);
                }
            });
        }
    }