private void ScaleDownMenuItems()
 {
     if (fromDaily)
     {
         sun.localScale = Vector3.zero;
         sun.gameObject.SetActive(value: false);
         proBadge.transform.localScale = Vector3.zero;
         startButton.localScale        = Vector3.zero;
         dailyButton.localScale        = Vector3.zero;
         shopButton.localScale         = Vector3.zero;
         levelsButton.localScale       = Vector3.zero;
         settingsButton.localScale     = Vector3.zero;
         facebookButton.localScale     = Vector3.zero;
         logo.localScale        = Vector3.zero;
         questButton.localScale = Vector3.zero;
         questButton.gameObject.SetActive(value: false);
     }
     else
     {
         SoundManager.instance.SlideOut();
         StartCoroutine(FugoUtils.Scaler(Vector3.zero, 0.3f, sun));
         StartCoroutine(FugoUtils.Scaler(Vector3.zero, 0.3f, startButton));
         StartCoroutine(FugoUtils.Scaler(Vector3.zero, 0.3f, dailyButton));
         StartCoroutine(FugoUtils.Scaler(Vector3.zero, 0.3f, shopButton.parent));
         StartCoroutine(FugoUtils.Scaler(Vector3.zero, 0.3f, levelsButton));
         StartCoroutine(FugoUtils.Scaler(Vector3.zero, 0.3f, settingsButton));
         StartCoroutine(FugoUtils.Scaler(Vector3.zero, 0.3f, facebookButton));
         StartCoroutine(FugoUtils.Scaler(Vector3.zero, 0.3f, logo));
         StartCoroutine(FugoUtils.Scaler(Vector3.zero, 0.3f, proBadge.transform));
         StartCoroutine(FugoUtils.Scaler(Vector3.zero, 0.3f, questButton));
         questButton.gameObject.SetActive(value: false);
     }
 }
    private IEnumerator AnimateSetScreen()
    {
        StartCoroutine(FugoUtils.FadeImage(1f, 0.3f, bg));
        yield return(new WaitForSeconds(0.3f));

        SoundManager.instance.SlideIn();
        StartCoroutine(FugoUtils.FadeText(1f, animationTime, title));
        StartCoroutine(FugoUtils.FadeImage(1f, animationTime, levelsBG.GetComponent <Image>()));
        StartCoroutine(FugoUtils.FadeImage(1f, animationTime, ribbon));
        StartCoroutine(FugoUtils.Scaler(Vector3.one, animationTime, bigLevel));
        float       levelDelay = 0.1f;
        IEnumerator enumerator = levelHolder.GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                Transform go = (Transform)enumerator.Current;
                StartCoroutine(FugoUtils.Scaler(Vector3.one, levelDelay, go));
                levelDelay += 0.05f;
            }
        }
        finally
        {
            IDisposable disposable;
            IDisposable disposable2 = disposable = (enumerator as IDisposable);
            if (disposable != null)
            {
                disposable2.Dispose();
            }
        }
        ArrangeScrollPosition();
    }
    private IEnumerator IncreaseCoinAnimThread(float delay, bool withSound = true)
    {
        yield return(new WaitForSeconds(delay));

        int currentCoin = int.Parse(coinText.text);

        if (withSound)
        {
            StartCoroutine(IncreaseCoinSoundThread());
        }
        while (true)
        {
            currentCoin        = ((PlayerPrefsManager.GetCoin() - currentCoin <= 50) ? (currentCoin + 5) : (currentCoin + 50));
            coinText.text      = currentCoin.ToString();
            wheelCoinText.text = currentCoin.ToString();
            if (currentCoin >= PlayerPrefsManager.GetCoin())
            {
                break;
            }
            ArabicController.MakeArabicMenu(coinText.transform);
            ArabicController.MakeArabicMenu(wheelCoinText.transform);
            yield return(new WaitForSeconds(0.03f));
        }
        coinText.text      = PlayerPrefsManager.GetCoin().ToString();
        wheelCoinText.text = PlayerPrefsManager.GetCoin().ToString();
        StartCoroutine(FugoUtils.Scaler(Vector3.one * 1.2f, 0.1f, coinText.transform.parent));
        StartCoroutine(FugoUtils.Scaler(Vector3.one * 1.2f, 0.1f, wheelCoinText.transform));
        yield return(new WaitForSeconds(0.1f));

        StartCoroutine(FugoUtils.Scaler(Vector3.one * 1f, 0.1f, coinText.transform.parent));
        StartCoroutine(FugoUtils.Scaler(Vector3.one * 1f, 0.1f, wheelCoinText.transform));
    }
Example #4
0
 private void OnEnable()
 {
     StopAllCoroutines();
     base.transform.localScale = Vector3.zero;
     StartCoroutine(FugoUtils.Scaler(Vector3.one, 0.3f, base.transform));
     FugoUtils.ChangeAlpha(shine, 0f);
     StartCoroutine(SunShineEffect(0.3f));
 }
    private IEnumerator AnimateStarThread()
    {
        contButton.GetComponent <Button>().interactable = false;
        SoundManager.instance.DailyReward();
        yield return(new WaitForSeconds(0.3f));

        gainedStarText.text = PlayerPrefsManager.GetEarnedStar().ToString();
        int tStar         = PlayerPrefsManager.GetDailyProcess();
        int remainingStar = PlayerPrefsManager.GetEarnedStar() - 1;

        for (int i = 0; i < PlayerPrefsManager.GetEarnedStar(); i++)
        {
            Transform star = UnityEngine.Object.Instantiate(starPrefab, starHolder).transform;
            star.localScale    = Vector3.one;
            star.localPosition = Vector3.zero;
            if (tStar + i >= totalKeys)
            {
                StartCoroutine(FugoUtils.CurveMover(shopButton.position, 1.5f, star));
            }
            else
            {
                StartCoroutine(FugoUtils.CurveMover(starDestination.position, 1.5f, star));
            }
            UnityEngine.Object.Destroy(star.gameObject, 1.5f);
            StartCoroutine(DelaySetTexts(1.5f, remainingStar));
            remainingStar--;
            yield return(new WaitForSeconds(0.2f));
        }
        yield return(new WaitForSeconds(1.5f));

        StartCoroutine(FugoUtils.Scaler(Vector3.zero, 0.3f, starHolder));
        PlayerPrefsManager.SetEarnedStar(0);
        MenuController.fromDaily = false;
        float perc = (float)PlayerPrefsManager.GetDailyProcess() / (float)totalKeys;

        if (nextGift + 1 < prizePercentages.Length && perc >= (float)prizePercentages[nextGift + 1] / 100f)
        {
            rewardHolder.GetChild(nextGift + 1).Find("Circle/Box").GetComponent <Image>()
            .sprite = boxesOpened[nextGift + 1];
            prizeCoinAmounts[nextGift] += prizeCoinAmounts[nextGift + 1];
        }
        if (nextGift < prizePercentages.Length && perc >= (float)prizePercentages[nextGift] / 100f)
        {
            StartCoroutine(GiveGift());
            rewardHolder.GetChild(nextGift).Find("Circle/Box").GetComponent <Image>()
            .sprite = boxesOpened[nextGift];
        }
        if (PlayerPrefsManager.GetDailyProcess() == totalKeys)
        {
            PlayerPrefsManager.SetGalleryString(DateTime.Now.Month.ToString());
            SetGallery();
            StartCoroutine(MonthFinishedThread());
            keyText.gameObject.SetActive(value: false);
        }
        yield return(new WaitForSeconds(1f));

        contButton.GetComponent <Button>().interactable = true;
    }
    private IEnumerator AnimateSetScreenExit()
    {
        isAnimating = true;
        StartCoroutine(FugoUtils.FadeText(0f, animationTime, title));
        StartCoroutine(FugoUtils.FadeImage(0f, animationTime, levelsBG.GetComponent <Image>()));
        StartCoroutine(FugoUtils.FadeImage(0f, animationTime, ribbon));
        StartCoroutine(FugoUtils.Scaler(Vector3.zero, animationTime, bigLevel));
        IEnumerator enumerator = levelHolder.GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                Transform go = (Transform)enumerator.Current;
                StartCoroutine(FugoUtils.Scaler(Vector3.zero, animationTime, go));
            }
        }
        finally
        {
            IDisposable disposable;
            IDisposable disposable2 = disposable = (enumerator as IDisposable);
            if (disposable != null)
            {
                disposable2.Dispose();
            }
        }
        yield return(new WaitForSeconds(animationTime));

        StartCoroutine(FugoUtils.FadeImage(0f, 0.2f, bg));
        GetComponent <SectionController>().OpeningAnimation(0.18f);
        yield return(new WaitForSeconds(0.2f));

        IEnumerator enumerator2 = levelHolder.GetEnumerator();

        try
        {
            while (enumerator2.MoveNext())
            {
                Transform transform = (Transform)enumerator2.Current;
                UnityEngine.Object.Destroy(transform.gameObject);
            }
        }
        finally
        {
            IDisposable disposable;
            IDisposable disposable3 = disposable = (enumerator2 as IDisposable);
            if (disposable != null)
            {
                disposable3.Dispose();
            }
        }
        panel.gameObject.SetActive(value: false);
        yield return(new WaitForSeconds(0.5f));

        StopAllCoroutines();
        isAnimating = false;
    }
 private IEnumerator OpenGalleryThread()
 {
     gallery.localScale = Vector3.zero;
     FugoUtils.ChangeAlpha(gallery.parent.parent.GetComponent <Image>(), 0f);
     galleryPanel.gameObject.SetActive(value: true);
     gallery.gameObject.SetActive(value: true);
     StartCoroutine(FugoUtils.Scaler(Vector3.one, 0.3f, gallery));
     StartCoroutine(FugoUtils.FadeImage(0.5f, 0.3f, galleryPanel.GetComponent <Image>()));
     yield return(null);
 }
Example #8
0
    private IEnumerator Flicker(Transform t, float delay, int count)
    {
        for (int i = 0; i < count; i++)
        {
            StartCoroutine(FugoUtils.Scaler(Vector3.one * 1.2f, delay, t));
            yield return(new WaitForSeconds(delay));

            StartCoroutine(FugoUtils.Scaler(Vector3.one * 1f, delay, t));
            yield return(new WaitForSeconds(delay));
        }
    }
    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 BoxAnimThread(Transform t)
    {
        float time = 1f;

        StartCoroutine(FugoUtils.Scaler(Vector3.one * 1.1f, time, t));
        yield return(new WaitForSeconds(time));

        StartCoroutine(FugoUtils.Scaler(Vector3.one * 1f, time, t));
        yield return(new WaitForSeconds(time));

        StartCoroutine(BoxAnimThread(t));
    }
    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);
    }
    private IEnumerator CloseGalleryThread(float time)
    {
        if ((double)time > 0.01)
        {
            SoundManager.instance.Click();
        }
        StartCoroutine(FugoUtils.Scaler(Vector3.zero, time, gallery));
        StartCoroutine(FugoUtils.FadeImage(0f, time, galleryPanel.GetComponent <Image>()));
        yield return(new WaitForSeconds(time));

        galleryPanel.gameObject.SetActive(value: false);
        gallery.gameObject.SetActive(value: false);
    }
Example #13
0
    private IEnumerator BGAnimThread2()
    {
        float delay = 1f;

        while (true)
        {
            StartCoroutine(FugoUtils.Scaler(0.9f * Vector3.one, delay, animation));
            yield return(new WaitForSeconds(delay));

            StartCoroutine(FugoUtils.Scaler(1f * Vector3.one, delay, animation));
            yield return(new WaitForSeconds(delay));
        }
    }
    private IEnumerator OpeningThread()
    {
        SetGallery();
        SetProcessBars();
        yield return(new WaitForSeconds(0.3f));

        Image[] images = panel.GetComponentsInChildren <Image>();
        Text[]  texts  = panel.GetComponentsInChildren <Text>();
        if (PlayerPrefsManager.GetLang() != "Arabic" && PlayerPrefsManager.GetLang() != "Hebrew")
        {
            StartCoroutine(FugoUtils.Scaler(Vector3.one, 0.3f, shopButton));
        }
        else
        {
            StartCoroutine(FugoUtils.Scaler(new Vector3(-1f, 1f, 1f), 0.3f, shopButton));
        }
        StartCoroutine(FugoUtils.Scaler(Vector3.one, 0.3f, shopButton.Find("ShopButton")));
        Image[] array = images;
        foreach (Image image in array)
        {
            if (!image.name.ToLower().Contains("button") && !image.name.ToLower().Contains("panel") && !(image.name.ToLower() == "imageholder"))
            {
                FugoUtils.ChangeAlpha(image, 0f);
                if (image.name == "ImageBW")
                {
                    StartCoroutine(FugoUtils.FadeImage(0.5f, 0.3f, image));
                }
                else if (image.name.ToLower() == "bgframe")
                {
                    StartCoroutine(FugoUtils.FadeImage(0.1f, 0.3f, image));
                }
                else
                {
                    StartCoroutine(FugoUtils.FadeImage(1f, 0.3f, image));
                }
            }
        }
        Text[] array2 = texts;
        foreach (Text text in array2)
        {
            FugoUtils.ChangeAlpha(text, 0f);
            StartCoroutine(FugoUtils.FadeText(1f, 0.3f, text));
        }
        panel.gameObject.SetActive(value: true);
        if (PlayerPrefsManager.GetEarnedStar() > 0)
        {
            StartCoroutine(AnimateStarThread());
        }
    }
    private IEnumerator EndThread()
    {
        yield return(new WaitForSeconds(1f));

        MenuController.instance.IncreaseCoinAnim(0f);
        yield return(new WaitForSeconds(0.4f));

        giftPopup.GetComponent <Animator>().enabled = false;
        StartCoroutine(FugoUtils.Scaler(Vector3.zero, 0.3f, giftPopup));
        yield return(new WaitForSeconds(0.3f));

        UnityEngine.Object.Destroy(coin.gameObject);
        UnityEngine.Object.Destroy(gift.gameObject);
        StopAllCoroutines();
        rewardAmountText.gameObject.SetActive(value: false);
    }
    private IEnumerator AnimateCurrentLevel(Transform t, float delay)
    {
        yield return(new WaitForSeconds(delay));

        if (t == null)
        {
            yield return(null);

            yield break;
        }
        float time = 1f;

        StartCoroutine(FugoUtils.Scaler(Vector3.one * 1f, time, t));
        yield return(new WaitForSeconds(time));

        StartCoroutine(FugoUtils.Scaler(Vector3.one * 1.1f, time, t));
        yield return(new WaitForSeconds(time));

        StartCoroutine(AnimateCurrentLevel(t, 0f));
    }
    private IEnumerator AnimateQuestButton()
    {
        if (ThemeManager.theme != 1)
        {
            yield return(new WaitForSeconds(3f));

            float time = 0.5f;
            for (int i = 0; i < 3; i++)
            {
                StartCoroutine(FugoUtils.Scaler(Vector3.one * 1.1f, time / 3f, questButton));
                yield return(new WaitForSeconds(time / 3f));

                StartCoroutine(FugoUtils.Scaler(Vector3.one * 1f, time, questButton));
                yield return(new WaitForSeconds(time));
            }
            yield return(new WaitForSeconds(time * 5f));

            StartCoroutine(AnimateQuestButton());
        }
    }
Example #18
0
    private IEnumerator PopupCloseThread(float time, Transform popup, bool fadePanelInteraction = true)
    {
        if (time > 0.01f)
        {
            SoundManager.instance.SlideOut();
        }
        popup.GetComponent <Animator>().enabled = false;
        if (fadePanelInteraction)
        {
            StartCoroutine(FugoUtils.FadeImage(0f, time, fadePanel));
        }
        StartCoroutine(FugoUtils.Scaler(Vector3.zero, time, popup));
        yield return(new WaitForSeconds(time));

        if (fadePanelInteraction)
        {
            fadePanel.gameObject.SetActive(value: false);
        }
        popup.gameObject.SetActive(value: false);
    }
    private IEnumerator ClosingThread()
    {
        Image[] images = panel.GetComponentsInChildren <Image>();
        Text[]  texts  = panel.GetComponentsInChildren <Text>();
        StartCoroutine(FugoUtils.Scaler(Vector3.zero, 0.3f, shopButton));
        Image[] array = images;
        foreach (Image image in array)
        {
            if (!image.name.ToLower().Contains("button") && !image.name.ToLower().Contains("panel"))
            {
                StartCoroutine(FugoUtils.FadeImage(0f, 0.3f, image));
            }
        }
        Text[] array2 = texts;
        foreach (Text go in array2)
        {
            StartCoroutine(FugoUtils.FadeText(0f, 0.3f, go));
        }
        yield return(new WaitForSeconds(0.3f));

        panel.gameObject.SetActive(value: false);
        MenuController.instance.AnimateMenu();
    }
    private IEnumerator MonthFinishedThread()
    {
        Transform image = UnityEngine.Object.Instantiate(normalImg.gameObject, panel).transform;

        image.localScale = Vector3.one;
        image.position   = normalImg.transform.position;
        image.GetComponent <Image>().fillAmount = 1f;
        UnityEngine.Object.Destroy(image.gameObject, 2f);
        galleryButton.gameObject.SetActive(value: true);
        StartCoroutine(FugoUtils.Scaler(Vector3.zero, 0.5f, image));
        StartCoroutine(FugoUtils.CurveMoverLeft(galleryButton.position, 0.5f, image));
        yield return(new WaitForSeconds(0.5f));

        SoundManager.instance.DailyPuzzleCollected();
        galleryButton.GetComponent <Animator>().enabled = false;
        StartCoroutine(FugoUtils.Scaler(Vector3.one * 1.2f, 0.2f, galleryButton));
        yield return(new WaitForSeconds(0.2f));

        StartCoroutine(FugoUtils.Scaler(Vector3.one, 0.2f, galleryButton));
        yield return(new WaitForSeconds(0.2f));

        galleryButton.GetComponent <Animator>().enabled = true;
    }
Example #21
0
    private IEnumerator SpinThread(bool toLeft = false)
    {
        animating = true;
        float time = UnityEngine.Random.Range(6f, 9f);

        StartCoroutine(Rotator(time, toLeft));
        yield return(new WaitForSeconds(time));

        yield return(null);

        Vector3 eulerAngles = sliceHolder.localRotation.eulerAngles;
        int     prize       = WhichPrize(eulerAngles.z);
        int     repeatcount = 3;
        float   delay       = 0.15f;

        if (prizes[prize] > 0)
        {
            PlayerPrefsManager.SetCoin(PlayerPrefsManager.GetCoin() + prizes[prize]);
            if (PlayerPrefsManager.GetPro())
            {
                PlayerPrefsManager.SetCoin(PlayerPrefsManager.GetCoin() + prizes[prize]);
            }
            StartCoroutine(Flicker(sliceHolder.GetChild(prize).Find("PrizeHolder/CoinHolder"), delay, repeatcount));
            StartCoroutine(Flicker(sliceHolder.GetChild(prize).Find("PrizeHolder/AmountText"), delay, repeatcount));
            yield return(new WaitForSeconds((float)repeatcount * delay * 2f));

            Vector3 pos2        = sliceHolder.GetChild(prize).Find("PrizeHolder/CoinHolder").position;
            int     coinAmount2 = GetCoinAmount(prizes[prize]);
            StartCoroutine(CreateAnimCoinsRealPos(sliceHolder.parent.parent, pos2, coinAmount2, coinHolder));
            yield return(new WaitForSeconds(1.5f + 0.1f * (float)coinAmount2));
        }
        else if (prizes[prize] < 0)
        {
            PlayerPrefsManager.SetHintDiscountTime(DateTime.Now.AddHours(Mathf.Abs(prizes[prize])).ToString());
            StartCoroutine(Flicker(sliceHolder.GetChild(prize).Find("PrizeHolder/HintHolder"), delay, repeatcount));
            StartCoroutine(Flicker(sliceHolder.GetChild(prize).Find("PrizeHolder/AmountText"), delay, repeatcount));
            yield return(new WaitForSeconds((float)repeatcount * delay));

            hintPopup.localScale = Vector3.zero;
            hintPopup.gameObject.SetActive(value: true);
            StartCoroutine(FugoUtils.Scaler(Vector3.one, 0.3f, hintPopup));
            yield return(new WaitForSeconds(3f));

            StartCoroutine(FugoUtils.Scaler(Vector3.zero, 0.3f, hintPopup));
            yield return(new WaitForSeconds(0.3f));

            hintPopup.gameObject.SetActive(value: false);
        }
        else
        {
            PlayerPrefsManager.SetCoin(PlayerPrefsManager.GetCoin() + 100);
            StartCoroutine(Flicker(sliceHolder.GetChild(prize).Find("PrizeHolder/CoinHolder"), delay, repeatcount));
            StartCoroutine(Flicker(sliceHolder.GetChild(prize).Find("PrizeHolder/AmountText"), delay, repeatcount));
            yield return(new WaitForSeconds((float)repeatcount * delay * 2f));

            Vector3 pos        = sliceHolder.GetChild(prize).Find("PrizeHolder/CoinHolder").position;
            int     coinAmount = GetCoinAmount(100);
            StartCoroutine(CreateAnimCoinsRealPos(sliceHolder.parent.parent, pos, coinAmount, coinHolder));
            StartCoroutine(ConfettiThread());
            yield return(new WaitForSeconds(1.5f + 0.1f * (float)coinAmount));

            SoundManager.instance.FortuneWheel();
            MenuController.instance.OpenTrialProPopup();
            yield return(new WaitForSeconds(0.3f));
        }
        animating      = false;
        firstTimeOfDay = false;
        rewardedReady  = false;
        SetSpinButton();
    }
Example #22
0
    private IEnumerator MenuThread()
    {
        proBadge.transform.localScale          = Vector3.zero;
        startButton.transform.localScale       = Vector3.zero;
        dailyButton.transform.localScale       = Vector3.zero;
        levelsButton.transform.localScale      = Vector3.zero;
        shopButton.parent.transform.localScale = Vector3.zero;
        questButton.localScale = Vector3.zero;
        sun.localScale         = Vector3.zero;
        sun.gameObject.SetActive(value: true);
        QuestController.instance.SetQuestButton();
        if (fromGame && GameController.set != null)
        {
            AfterGameFadeIn(GameController.set);
            yield return(new WaitForSeconds(0.4f));

            fromGame = false;
        }
        if (!SplashScript.splashShown)
        {
            yield return(new WaitForSeconds(SplashScript.splashTime));
        }
        SoundManager.instance.SlideIn();
        yield return(new WaitForSeconds(0.1f));

        if (PlayerPrefsManager.GetDailyPuzzleNewLabel() > 0)
        {
            dailyButton.Find("NewLabel").gameObject.SetActive(value: true);
        }
        else
        {
            dailyButton.Find("NewLabel").gameObject.SetActive(value: false);
        }
        animBG.gameObject.SetActive(value: false);
        StartCoroutine(FugoUtils.Scaler(Vector3.one, 0.3f, startButton));
        StartCoroutine(FugoUtils.Scaler(Vector3.one, 0.3f, logo));
        StartCoroutine(FugoUtils.Scaler(Vector3.one, 0.3f, settingsButton));
        StartCoroutine(FugoUtils.Scaler(Vector3.one, 0.3f, facebookButton));
        StartCoroutine(FugoUtils.Scaler(Vector3.one, 0.3f, sun));
        StartCoroutine(FugoUtils.Scaler(Vector3.one, 0.3f, proBadge.transform));
        yield return(new WaitForSeconds(0.1f));

        if (PlayerPrefsManager.GetLevel() >= 5)
        {
            StartCoroutine(FugoUtils.Scaler(Vector3.one, 0.3f, levelsButton));
        }
        yield return(new WaitForSeconds(0.1f));

        if (PlayerPrefsManager.GetLevel() >= 13)
        {
            StartCoroutine(FugoUtils.Scaler(Vector3.one, 0.3f, dailyButton));
        }
        yield return(new WaitForSeconds(0.1f));

        StartCoroutine(FugoUtils.Scaler(Vector3.one, 0.3f, questButton));
        if (PlayerPrefsManager.GetLang() != "Arabic" && PlayerPrefsManager.GetLang() != "Hebrew")
        {
            StartCoroutine(FugoUtils.Scaler(Vector3.one, 0.3f, shopButton.parent));
        }
        else
        {
            StartCoroutine(FugoUtils.Scaler(new Vector3(-1f, 1f, 1f), 0.3f, shopButton.parent));
        }
    }