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 CloseImagePreviewThread()
    {
        StartCoroutine(FugoUtils.FadeImage(0f, 0.3f, imagePanel.GetComponent <Image>()));
        StartCoroutine(FugoUtils.FadeImage(0f, 0.3f, imageHolder.GetComponent <Image>()));
        StartCoroutine(FugoUtils.FadeText(0f, 0.3f, imagePanel.Find("PreviewCountryText").GetComponent <Text>()));
        yield return(new WaitForSeconds(0.3f));

        imagePanel.gameObject.SetActive(value: false);
    }
    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 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 ErrorText(string str)
    {
        errorText.text = str;
        FugoUtils.ChangeAlpha(errorText, 1f);
        errorText.gameObject.SetActive(value: true);
        yield return(new WaitForSeconds(2f));

        StartCoroutine(FugoUtils.FadeText(0f, 0.3f, errorText));
        yield return(new WaitForSeconds(0.3f));

        errorText.gameObject.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);
    }
 public void GalleryPicOnClick(Transform t)
 {
     UnityEngine.Debug.Log(t.name);
     SoundManager.instance.Click();
     imageHolder.GetComponent <Image>().sprite = t.GetComponent <Image>().sprite;
     StartCoroutine(FugoUtils.FadeImage(1f, 0.3f, imageHolder.GetComponent <Image>()));
     imagePanel.GetComponent <Image>().color = new Color(0f, 0f, 0f, 0f);
     imagePanel.Find("PreviewCountryText").GetComponent <Text>().color = new Color(1f, 1f, 1f, 0f);
     imagePanel.Find("PreviewCountryText").GetComponent <Text>().text  = Games.sections[int.Parse(t.name)].Title;
     StartCoroutine(FugoUtils.FadeText(1f, 0.3f, imagePanel.Find("PreviewCountryText").GetComponent <Text>()));
     StartCoroutine(FugoUtils.FadeImage(1f, 0.3f, imagePanel.GetComponent <Image>()));
     imagePanel.gameObject.SetActive(value: true);
 }
    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());
        }
    }
Example #9
0
 public void FadeAllComponents(float aValue, float aTime, Transform go)
 {
     Text[]  allComponents  = go.GetAllComponents <Text>();
     Image[] allComponents2 = go.GetAllComponents <Image>();
     Text[]  array          = allComponents;
     foreach (Text go2 in array)
     {
         StartCoroutine(FugoUtils.FadeText(aValue, aTime, go2));
     }
     Image[] array2 = allComponents2;
     foreach (Image go3 in array2)
     {
         StartCoroutine(FugoUtils.FadeImage(aValue, aTime, go3));
     }
 }
    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();
    }