private IEnumerator DelaySetTexts(float time, int remainingStar)
    {
        yield return(new WaitForSeconds(time));

        if (PlayerPrefsManager.GetDailyProcess() < totalKeys)
        {
            PlayerPrefsManager.SetDailyProcess(PlayerPrefsManager.GetDailyProcess() + 1);
        }
        float perc = (float)PlayerPrefsManager.GetDailyProcess() / (float)totalKeys;

        StartCoroutine(FugoUtils.FillImage(perc, 0.2f, normalImg));
        StartCoroutine(FugoUtils.FillImage(perc, 0.2f, bar));
        Vector2 sizeDelta = bar.GetComponent <RectTransform>().sizeDelta;

        StartCoroutine(FugoUtils.Mover(new Vector3(-370f + sizeDelta.x * perc, 0f, 0f), 0.2f, keyText.transform));
        keyText.text        = PlayerPrefsManager.GetDailyProcess().ToString();
        gainedStarText.text = remainingStar.ToString();
        if (PlayerPrefsManager.GetDailyProcess() >= totalKeys)
        {
            PlayerPrefsManager.SetCoin(PlayerPrefsManager.GetCoin() + 5);
        }
        SoundManager.instance.CoinIncrease();
        yield return(new WaitForSeconds(0.2f));

        MenuController.instance.IncreaseCoinAnim(0f);
    }
    private IEnumerator GiftThread(Transform t)
    {
        StartCoroutine(FugoUtils.FadeImage(1f, 0.2f, rewardBG.GetComponent <Image>()));
        yield return(new WaitForSeconds(0.2f));

        StartCoroutine(FugoUtils.Mover(Vector3.zero, 0.2f, t));
        yield return(new WaitForSeconds(0.2f));

        StartCoroutine(FugoUtils.Scaler(Vector3.one * 1.2f, 0.2f, t));
        yield return(new WaitForSeconds(0.1f));

        particles.SetActive(value: true);
        yield return(new WaitForSeconds(0.1f));

        Vector3 topPos = t.Find("Top").transform.localPosition;

        topPos.y += 40f;
        StartCoroutine(FugoUtils.Mover(topPos, 0.2f, t.Find("Top")));
        yield return(new WaitForSeconds(0.2f));

        coin = CreateCoin(rewardBG, reward);
        SoundManager.instance.DailyReward();
        Vector3 coinpos = coin.localPosition;

        coinpos.y += 100f;
        StartCoroutine(FugoUtils.FadeImage(1f, 0.3f, coin.Find("Shine").GetComponent <Image>()));
        StartCoroutine(FugoUtils.FadeImage(1f, 0.3f, coin.Find("Coin").GetComponent <Image>()));
        StartCoroutine(FugoUtils.Mover(coinpos, 0.3f, coin));
        StartCoroutine(Rotator(coin.Find("Shine")));
        yield return(new WaitForSeconds(0.3f));

        StartCoroutine(FugoUtils.FadeImage(0f, 0.2f, t.Find("Top").GetComponent <Image>()));
        StartCoroutine(FugoUtils.FadeImage(0f, 0.2f, t.Find("Bottom").GetComponent <Image>()));
        StartCoroutine(FugoUtils.FadeText(1f, 0.3f, congratzText));
        StartCoroutine(FugoUtils.FadeText(1f, 0.3f, rewardAmountText.GetComponent <Text>()));
        StartCoroutine(FugoUtils.FadeText(1f, 0.3f, rewardHintText.GetComponent <Text>()));
        StartCoroutine(FugoUtils.FadeText(1f, 0.3f, proBadge.transform.Find("Text").GetComponent <Text>()));
        StartCoroutine(FugoUtils.FadeImage(1f, 0.3f, rewardAmountText.Find("CoinImage").GetComponent <Image>()));
        StartCoroutine(FugoUtils.FadeImage(1f, 0.3f, proBadge.GetComponent <Image>()));
        StartCoroutine(FugoUtils.Scaler(Vector3.one, 0.3f, coin));
        StartCoroutine(FugoUtils.Mover(Vector3.zero, 0.3f, coin));
        yield return(new WaitForSeconds(0.3f));

        StartCoroutine(FugoUtils.Scaler(Vector3.one, 0.3f, collectButton));
        StartCoroutine(FugoUtils.Scaler(Vector3.one, 0.3f, rewardedButton));
        yield return(new WaitForSeconds(0.3f));

        collectButton.GetComponent <Animator>().enabled  = true;
        rewardedButton.GetComponent <Animator>().enabled = true;
        yield return(new WaitForSeconds(3f));

        particles.SetActive(value: false);
    }
    private IEnumerator GiveGift()
    {
        rewardAmountText.GetComponent <Text>().text  = "+" + prizeCoinAmounts[nextGift].ToString();
        rewardAmountText.GetComponent <Text>().color = FugoUtils.HexToColor("FFFFFF00");
        rewardAmountText.Find("CoinImage").GetComponent <Image>().color = FugoUtils.HexToColor("FFFFFF00");
        congratzText.GetComponent <Text>().color = FugoUtils.HexToColor("FFFFFF00");
        collectButton.transform.localScale       = Vector3.zero;
        gift            = UnityEngine.Object.Instantiate(DailyGiftSystem.instance.giftPrefab, giftPopup).transform;
        gift.localScale = Vector3.one;
        gift.Find("Top").GetComponent <Image>().sprite    = DailyGiftSystem.instance.tops[boxes[nextGift]];
        gift.Find("Bottom").GetComponent <Image>().sprite = DailyGiftSystem.instance.bottoms[boxes[nextGift]];
        giftPopup.gameObject.SetActive(value: true);
        giftPopup.GetComponent <Animator>().enabled = true;
        giftPopup.GetComponent <Animator>().Play("PopupOpen");
        yield return(new WaitForSeconds(0.5f));

        particles.SetActive(value: true);
        yield return(new WaitForSeconds(0.1f));

        Vector3 topPos = gift.Find("Top").transform.localPosition;

        topPos.y += 40f;
        StartCoroutine(FugoUtils.Mover(topPos, 0.2f, gift.Find("Top")));
        yield return(new WaitForSeconds(0.2f));

        coin = DailyGiftSystem.instance.CreateCoin(giftPopup, prizeCoinAmounts[nextGift]);
        coin.SetAsFirstSibling();
        SoundManager.instance.DailyReward();
        Vector3 coinpos = coin.localPosition;

        coinpos.y += 100f;
        StartCoroutine(FugoUtils.FadeImage(1f, 0.3f, coin.Find("Shine").GetComponent <Image>()));
        StartCoroutine(FugoUtils.FadeImage(1f, 0.3f, coin.Find("Coin").GetComponent <Image>()));
        StartCoroutine(FugoUtils.Mover(coinpos, 0.3f, coin));
        StartCoroutine(Rotator(coin.Find("Shine")));
        yield return(new WaitForSeconds(0.3f));

        StartCoroutine(FugoUtils.FadeImage(0f, 0.2f, gift.Find("Top").GetComponent <Image>()));
        StartCoroutine(FugoUtils.FadeImage(0f, 0.2f, gift.Find("Bottom").GetComponent <Image>()));
        StartCoroutine(FugoUtils.FadeText(1f, 0.3f, congratzText));
        StartCoroutine(FugoUtils.FadeText(1f, 0.3f, rewardAmountText.GetComponent <Text>()));
        StartCoroutine(FugoUtils.FadeImage(1f, 0.3f, rewardAmountText.Find("CoinImage").GetComponent <Image>()));
        StartCoroutine(FugoUtils.Scaler(Vector3.one, 0.3f, coin));
        StartCoroutine(FugoUtils.Mover(Vector3.zero, 0.3f, coin));
        yield return(new WaitForSeconds(0.3f));

        collectButton.transform.localScale = Vector3.zero;
        StartCoroutine(FugoUtils.Scaler(Vector3.one, 0.3f, collectButton));
        yield return(new WaitForSeconds(3f));

        particles.SetActive(value: false);
    }