Beispiel #1
0
    public void onlyStroke()
    {
        float     num       = 0.2f;
        float     time      = 0.15f;
        Transform transform = PreviewController.instance.wordContainer.parent.parent.transform;
        Vector3   position  = transform.position;
        float     num2      = position.y;
        Vector3   position2 = base.transform.position;
        float     num3      = num2 - position2.y;

        if (num3 > 0f)
        {
            float   num4      = num3;
            Vector2 sizeDelta = rect.sizeDelta;
            float   num5      = num4 / sizeDelta.x;
            num *= (float)Math.Pow(0.090000003576278687, num5 * 100f);
        }
        GameObject gameObject  = base.transform.Find("BG/Stroke").gameObject;
        GameObject gameObject2 = base.transform.Find("BG").gameObject;
        GameObject gameObject3 = base.transform.Find("BG/Text").gameObject;

        gameObject.GetComponent <Image>().color = GameController.SelectedLetterBGColor;
        FugoUtils.ChangeAlpha(gameObject.GetComponent <Image>(), 0f);
        gameObject.SetActive(value: true);
        Movements.instance.startFadeIn(gameObject2, time, num);
        Movements.instance.startFadeIn(gameObject3, time, num);
    }
Beispiel #2
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));
 }
Beispiel #3
0
 public void disableBlur()
 {
     SoundManager.instance.blurReveal();
     if (!PlayerPrefsManager.IsBlurOn())
     {
         FugoUtils.ChangeAlpha(base.transform.GetComponent <Image>(), 0f);
     }
     Movements.instance.startFadeOut(base.gameObject, 1f, 0f);
 }
 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);
 }
 private IEnumerator OpenPopupThread()
 {
     popup.gameObject.SetActive(value: true);
     popup.transform.localScale = Vector3.one;
     popup.GetComponent <Animator>().enabled = true;
     popup.GetComponent <Animator>().Play("PopupOpen");
     FugoUtils.ChangeAlpha(galleryPanel.GetComponent <Image>(), 0f);
     StartCoroutine(FugoUtils.FadeImage(0.5f, 0.3f, galleryPanel.GetComponent <Image>()));
     galleryPanel.gameObject.SetActive(value: true);
     yield return(null);
 }
Beispiel #6
0
    public void openCell()
    {
        GameObject gameObject  = base.transform.Find("BG").gameObject;
        GameObject gameObject2 = base.transform.Find("BG/Text").gameObject;

        gameObject.SetActive(value: true);
        gameObject2.SetActive(value: true);
        bg.color = GameController.SelectedLetterBGColor;
        gameObject2.GetComponent <Text>().color = GameController.InGameSelectedLetterColor;
        FugoUtils.ChangeAlpha(bg, 1f);
    }
Beispiel #7
0
 public void enableBlur()
 {
     if (!PlayerPrefsManager.IsBlurOn())
     {
         FugoUtils.ChangeAlpha(base.transform.GetComponent <Image>(), 0f);
     }
     else
     {
         Movements.instance.startFadeIn(base.gameObject, 1f, 1f);
     }
 }
    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);
    }
Beispiel #9
0
 public void placeLetter()
 {
     found = true;
     base.transform.Find("BG/Text").gameObject.SetActive(value: true);
     base.transform.Find("BG/Stroke").gameObject.SetActive(value: false);
     base.transform.Find("BG/Text").GetComponent <Text>().color = GameController.InGameSelectedLetterColor;
     FugoUtils.ChangeAlpha(base.transform.Find("BG/Text").GetComponent <Text>(), 1f);
     Movements.instance.lerpColorTo(base.transform.Find("BG").gameObject, GameController.SelectedLetterBGColor, 0.2f);
     Movements.instance.lerpColorTo(base.transform.Find("BG/Text").gameObject, GameController.InGameSelectedLetterColor, 0.2f);
     base.transform.Find("BG/Text").gameObject.SetActive(value: true);
     spawnCoin();
     checkStar();
 }
Beispiel #10
0
    public void enableStroke()
    {
        float      num        = 0.15f;
        GameObject gameObject = base.transform.Find("BG/Stroke").gameObject;

        gameObject.GetComponent <Image>().color = Color.Lerp(GameController.SelectedLetterBGColor, Color.black, 0.2f);
        FugoUtils.ChangeAlpha(gameObject.GetComponent <Image>(), 0f);
        gameObject.gameObject.SetActive(value: true);
        SoundManager.instance.LetterPlace();
        Movements.instance.startFadeIn(gameObject, num, 1f);
        Movements.instance.scale(base.gameObject, Vector3.one, Vector3.one * 1.5f, num);
        Movements.instance.scale(base.gameObject, Vector3.one * 1.5f, Vector3.one, num, num);
    }
Beispiel #11
0
 public void noBlur()
 {
     try
     {
         FugoUtils.ChangeAlpha(base.transform.GetComponent <Image>(), 0f);
     }
     catch (Exception)
     {
     }
     if (!PlayerPrefsManager.IsBlurOn())
     {
         FugoUtils.ChangeAlpha(base.transform.GetComponent <Image>(), 0f);
     }
 }
Beispiel #12
0
    private IEnumerator fadeIn(SpriteRenderer img, float animTime, float maxAlpha, float minAlpha)
    {
        float t = 0f;

        while (t <= animTime)
        {
            float alpha2 = t / animTime;
            alpha2 = (maxAlpha - minAlpha) * alpha2 + minAlpha;
            FugoUtils.ChangeAlpha(img, alpha2);
            t += Time.deltaTime;
            yield return(null);
        }
        FugoUtils.ChangeAlpha(img, maxAlpha);
    }
Beispiel #13
0
    public void CreateLevels(LevelSet set, bool isBlur = false)
    {
        if (isBlur)
        {
            bg.sprite = Resources.Load <Sprite>("BGImages/" + set.bgImage);
        }
        else
        {
            bg.sprite = Resources.Load <Sprite>("BGImages/" + set.bgImage);
        }
        CreateEmptyLevels(set.levels.Count);
        title.text   = set.SetFullName;
        title.color  = FugoUtils.HexToColor(set.TitleColor);
        ribbon.color = FugoUtils.HexToColor(set.RibbonColor);
        FugoUtils.ChangeAlpha(ribbon, 0f);
        FugoUtils.ChangeAlpha(title, 0f);
        FugoUtils.ChangeAlpha(levelsBG.GetComponent <Image>(), 0f);
        FugoUtils.ChangeAlpha(bg, 0f);
        Vector2 sizeDelta = levelsBG.GetComponent <RectTransform>().sizeDelta;

        sizeDelta.y = GetSizeOfBG(set.levels.Count);
        levelsBG.GetComponent <RectTransform>().sizeDelta = sizeDelta;
        int num = set.FirstLevel;

        for (int i = 0; i < set.levels.Count; i++)
        {
            Transform child = levelHolder.GetChild(i);
            child.name = num.ToString();
            if (num == PlayerPrefsManager.GetLevel())
            {
                SetLevelProperties(child, set, "current");
                PlaceLetters(child.Find("TextHolder"), set.levels[i].letters);
            }
            else if (num > PlayerPrefsManager.GetLevel())
            {
                SetLevelProperties(child, set, "locked");
            }
            else if (num < PlayerPrefsManager.GetLevel())
            {
                SetLevelProperties(child, set, "completed");
                PlaceLetters(child.Find("TextHolder"), set.levels[i].letters);
            }
            child.gameObject.SetActive(value: true);
            num++;
        }
        levelHolder.parent.parent.gameObject.SetActive(value: true);
        StartCoroutine(AnimateSetScreen(0.001f));
        ArabicController.MakeArabicMenu(levelHolder.parent.parent);
    }
    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());
        }
    }
Beispiel #15
0
    private IEnumerator fadeOut(Image img, float animTime, float maxAlpha, float minAlpha, float delay)
    {
        yield return(new WaitForSeconds(delay));

        float t = 0f;

        while (t <= animTime)
        {
            float alpha2 = t / animTime;
            alpha2 = (maxAlpha - minAlpha) * (1f - alpha2) + minAlpha;
            FugoUtils.ChangeAlpha(img, alpha2);
            t += Time.deltaTime;
            yield return(null);
        }
        FugoUtils.ChangeAlpha(img, minAlpha);
    }
Beispiel #16
0
    private IEnumerator fadeIn(Text txt, float animTime, float maxAlpha, float minAlpha, float delay)
    {
        yield return(new WaitForSeconds(delay));

        float t = 0f;

        while (t <= animTime)
        {
            float alpha2 = t / animTime;
            alpha2 = (maxAlpha - minAlpha) * alpha2 + minAlpha;
            FugoUtils.ChangeAlpha(txt, alpha2);
            t += Time.deltaTime;
            yield return(null);
        }
        FugoUtils.ChangeAlpha(txt, maxAlpha);
    }
Beispiel #17
0
 private void Start()
 {
     frame = base.transform.Find("Frame").gameObject;
     image = base.transform.Find("Image").gameObject;
     frame.SetActive(value: true);
     frame.GetComponent <RectTransform>().sizeDelta = image.GetComponent <RectTransform>().sizeDelta;
     frame.GetComponent <Image>().sprite            = image.GetComponent <Image>().sprite;
     FugoUtils.ChangeAlpha(frame.GetComponent <Image>(), 0f);
     frame.SetActive(value: false);
     frame.transform.SetAsLastSibling();
     HideFrame();
     AddTriggers();
     animator = GetComponent <Animator>();
     if (animator != null)
     {
         animator.enabled = false;
     }
 }
 public void BeforeGameFadeOut(LevelSet currentSet)
 {
     if (GameController.levelToOpen == -1)
     {
         animBG.GetComponent <Image>().sprite = Resources.Load <Sprite>("BGImages/" + currentSet.bgImage);
         if (animBG.GetComponent <Image>().sprite == null)
         {
             animBG.GetComponent <Image>().sprite = Resources.Load <Sprite>("BGImages/" + GameController.set.bgImage);
         }
     }
     else
     {
         animBG.GetComponent <Image>().sprite = Resources.Load <Sprite>("BGImages/" + currentSet.bgImage);
     }
     FugoUtils.ChangeAlpha(animBG.GetComponent <Image>(), 0f);
     StartCoroutine(FugoUtils.FadeImage(1f, 0.1f, animBG.GetComponent <Image>()));
     animBG.gameObject.SetActive(value: true);
 }
    public void startInitAnims()
    {
        FugoUtils.ChangeAlpha(hint.transform.Find("Hint/icon").GetComponent <Image>(), 0.5f);
        for (int i = 0; i < ribbonWords.Length; i++)
        {
            ribbonWords[i] = AutoLanguage.dict["Ribbon" + (i + 1)];
        }
        shuffle.SetActive(value: true);
        back.SetActive(value: true);
        hint.SetActive(value: true);
        store.SetActive(value: true);
        sections.SetActive(value: true);
        if (PlayerPrefsManager.GetLevel() >= 3)
        {
            Movements.instance.move(shuffle, shuffle.transform.position + Vector3.left * 1f, shuffle.transform.position, initTime);
        }
        Movements.instance.move(back, back.transform.position + Vector3.left * 1f, back.transform.position, initTime);
        if (PlayerPrefsManager.GetFirstExtra())
        {
            enableExtra();
        }
        Movements.instance.move(sections, sections.transform.position + Vector3.right * 1f, sections.transform.position, initTime);
        if (PlayerPrefsManager.GetLevel() >= 5)
        {
            Movements.instance.move(hint, hint.transform.position + Vector3.right * 1f, hint.transform.position, initTime);
        }
        if (PlayerPrefsManager.GetLevel() == 1)
        {
            store.SetActive(value: false);
        }
        else
        {
            Movements.instance.move(store, store.transform.position + Vector3.right * 3f, store.transform.position, initTime);
        }
        Movements.instance.startFadeIn(name, initTime, 1f);
        GameObject gameObject = end.transform.Find("LogoNStuff/Progress").gameObject;

        end.transform.Find("LogoNStuff/SunHolder/BrillianceText").GetComponent <Text>().text = PlayerPrefsManager.GetBrilliance().ToString() + "\n<color=#71b1e0><size=25>" + LanguageScript.ExpeditionText + "</size></color>";
        end.transform.Find("LogoNStuff/SunHolder/Core").GetComponent <Image>().color         = Color.black;
        UnityEngine.Debug.Log("init anim done");
    }
    private IEnumerator AfterGameFadeInThread(LevelSet currentSet)
    {
        FugoUtils.ChangeAlpha(animBG.GetComponent <Image>(), 1f);
        animBG.gameObject.SetActive(value: true);
        string bgPath = GameController.set.bgImage;

        if (GameController.levelToOpen == -1)
        {
            animBG.GetComponent <Image>().sprite = Resources.Load <Sprite>("BGImages/" + bgPath);
            if (animBG.GetComponent <Image>().sprite == null)
            {
                animBG.GetComponent <Image>().sprite = Resources.Load <Sprite>("BGImages/" + bgPath);
            }
        }
        else
        {
            animBG.GetComponent <Image>().sprite = Resources.Load <Sprite>("BGImages/" + bgPath);
        }
        StartCoroutine(FugoUtils.FadeImage(0f, 0.5f, animBG.GetComponent <Image>()));
        yield return(new WaitForSeconds(0.5f));

        animBG.gameObject.SetActive(value: false);
    }
Beispiel #21
0
    private IEnumerator FadeImage(GameObject img, Sprite newImg, float time)
    {
        GameObject copy = UnityEngine.Object.Instantiate(img);

        copy.transform.SetParent(img.transform.parent);
        copy.transform.position   = img.transform.position;
        copy.transform.localScale = img.transform.localScale;
        float t = 0f;

        img.GetComponent <Image>();
        Image replace = copy.GetComponent <Image>();

        copy.GetComponent <RectTransform>().sizeDelta = img.GetComponent <RectTransform>().sizeDelta;
        replace.sprite = newImg;
        while (t <= time)
        {
            float par = t / time;
            FugoUtils.ChangeAlpha(replace, par);
            t += Time.deltaTime;
            yield return(null);
        }
        UnityEngine.Object.Destroy(img);
    }
    public void createBoard()
    {
        logLevelStart();
        bonus = null;
        scale = base.transform.Find("Scale");
        Vector2 sizeDelta = cellTemp.GetComponent <RectTransform>().sizeDelta;

        cellSize = sizeDelta.x;
        float num = 1336f / (float)Screen.height;

        width = (float)Screen.width * num / cellSize;
        Vector2 sizeDelta2 = scale.parent.GetComponent <RectTransform>().sizeDelta;

        height = sizeDelta2.y / cellSize;
        if (levelToOpen == PlayerPrefsManager.GetLevel())
        {
            levelToOpen = -1;
        }
        if (levelToOpen == -1)
        {
            info = FugoUtils.getLevelInfo();
        }
        else
        {
            info = FugoUtils.getLevelInfo(levelToOpen);
        }
        DateTime now = DateTime.Now;

        if (daily)
        {
            sec   = Games.dailyPuzzles;
            set   = sec.sets[now.Month - 1];
            level = set.levels[now.Day - 1];
        }
        else
        {
            sec   = Games.sections[info[0]];
            set   = sec.sets[info[1]];
            level = set.levels[info[2]];
        }
        ParticleAnimationManager.instance.PlayAnimation(set);
        Cell.cellColor   = set.InGameTileColor;
        Cell.strokeColor = set.InGameSelectedLetterBGColor;
        nextSet          = (set.levels.Count - 1 == info[2] && (levelToOpen == -1 || levelToOpen == PlayerPrefsManager.GetLevel()));
        nextSec          = (sec.sets.Count - 1 == info[1] && (levelToOpen == -1 || levelToOpen == PlayerPrefsManager.GetLevel()) && nextSet);
        if (nextSet)
        {
            GameMenuController.instance.setGoldAmount(25);
        }
        if (nextSec)
        {
            GameMenuController.instance.setGoldAmount(100);
        }
        cellBGColor = FugoUtils.HexToColor(set.InGameSelectedLetterBGColor);
        board       = new GameObject[level.width, level.height];
        background.SetActive(value: true);
        string path   = "BGImages/" + set.bgImage;
        Sprite sprite = Resources.Load <Sprite>(path);

        background.GetComponent <Image>().sprite = sprite;
        background.transform.Find("Blur").gameObject.SetActive(value: false);
        if (PlayerPrefsManager.IsBlueMode())
        {
            background.SetActive(value: false);
        }
        if (levelToOpen != -1)
        {
            int[] levelInfo  = FugoUtils.getLevelInfo();
            int[] levelInfo2 = FugoUtils.getLevelInfo(levelToOpen);
            UnityEngine.Debug.Log(levelInfo[1]);
            UnityEngine.Debug.Log(levelInfo2[1]);
            blur = (levelInfo[1] == levelInfo2[1]);
        }
        else
        {
            blur = true;
        }
        if (blur)
        {
            background.transform.Find("Blur").gameObject.SetActive(value: true);
        }
        else
        {
            background.transform.Find("Blur").gameObject.SetActive(value: true);
            FugoUtils.ChangeAlpha(background.transform.Find("Blur").GetComponent <Image>(), 0f);
            BlurControl.instance.enableBlur();
        }
        if (daily)
        {
            background.transform.Find("Blur").gameObject.SetActive(value: false);
        }
        name.GetComponent <Text>().text  = set.SetFullName + " ● " + (info[2] + 1);
        name.GetComponent <Text>().color = FugoUtils.HexToColor(set.InGameHeaderColor);
        float a = width / (float)level.width;
        float b = height / (float)level.height;

        scaleAmount  = Mathf.Min(a, b);
        scaleAmount *= 0.9f;
        cellSize    *= scaleAmount;
        offsetX      = Vector2.up * ((float)level.height - height) * cellSize * 0.5f * scaleAmount;
        offsetY      = Vector2.left * ((float)level.width - width) * cellSize * 0.5f * scaleAmount;
        offsetX      = Vector2.left * cellSize * level.width * 0.5f + Vector2.right * cellSize * 0.5f;
        offsetY      = Vector2.up * cellSize * level.height * 0.5f + Vector2.down * cellSize * 0.5f;
        for (int i = 0; i < level.width; i++)
        {
            for (int j = 0; j < level.height; j++)
            {
                GameObject gameObject = UnityEngine.Object.Instantiate(cellTemp);
                gameObject.transform.SetParent(scale);
                gameObject.transform.localPosition = Vector3.zero;
                gameObject.transform.SetAsFirstSibling();
                gameObject.SetActive(value: false);
                RectTransform component = gameObject.GetComponent <RectTransform>();
                component.anchoredPosition  = (Vector3.right * i + Vector3.down * j) * cellSize;
                component.anchoredPosition += offsetX + offsetY;
                board[i, j] = gameObject;
                gameObject.transform.localScale            = Vector3.one;
                gameObject.transform.Find("BG").localScale = Vector3.zero;
                gameObject.transform.Find("BG/Text").GetComponent <Text>().color = FugoUtils.HexToColor(set.InGameHintColor);
                component.sizeDelta = Vector2.one * cellSize;
                Cell component2 = gameObject.GetComponent <Cell>();
                component2.x = i;
                component2.y = j;
            }
        }
        GameObject[,] array = board;
        int length  = array.GetLength(0);
        int length2 = array.GetLength(1);

        for (int k = 0; k < length; k++)
        {
            for (int l = 0; l < length2; l++)
            {
                GameObject gameObject2 = array[k, l];
                if (gameObject2.activeSelf)
                {
                }
            }
        }
        bool flag = false;

        foreach (Word word in level.words)
        {
            if (word.bonus)
            {
                flag  = true;
                bonus = word;
            }
            try
            {
                placeWord(word);
            }
            catch (Exception)
            {
            }
        }
        if (flag)
        {
            Movements.instance.executeWithDelay((Movements.Execute)TutorialController.instance.openBonus, 0.5f);
        }
        byte[] bytes = Encoding.Default.GetBytes(SystemInfo.deviceUniqueIdentifier);
        int    seed  = PlayerPrefsManager.GetLevel() + BitConverter.ToInt32(bytes, 0);

        UnityEngine.Random.InitState(seed);
        UnityEngine.Random.InitState(DateTime.Now.Millisecond);
        Movements.instance.executeWithDelay((Movements.Execute)WheelController.instance.newGame, 0.55f);
        MapController.instance.setColors();
        if (daily && PlayerPrefsManager.IsItFirstDaily())
        {
            Movements.instance.executeWithDelay((Movements.Execute)TutorialController.instance.openDaily, 1.5f);
        }
        if (levelToOpen == -1)
        {
            if (PlayerPrefsManager.GetLevel() == 1)
            {
                WheelController.running = false;
                UnityEngine.Debug.Log("tutorial1");
                Movements.instance.executeWithDelay((Movements.Execute)TutorialController.instance.openFirst, 1.5f);
            }
            if (PlayerPrefsManager.GetLevel() == 3)
            {
                WheelController.running = false;
                UnityEngine.Debug.Log("tutorial2");
                Movements.instance.executeWithDelay((Movements.Execute)TutorialController.instance.openSecond, 1.5f);
            }
            if (PlayerPrefsManager.GetLevel() == 5)
            {
                WheelController.running = false;
                UnityEngine.Debug.Log("tutorial3");
                Movements.instance.executeWithDelay((Movements.Execute)TutorialController.instance.openThird, 1.5f);
            }
        }
    }
    public void CreateLevels(LevelSet set)
    {
        curSet       = set;
        title.text   = set.SetFullName;
        title.color  = FugoUtils.HexToColor(set.TitleColor);
        ribbon.color = FugoUtils.HexToColor(set.RibbonColor);
        bg.sprite    = Resources.Load <Sprite>("BGImages/" + set.bgImage);
        FugoUtils.ChangeAlpha(ribbon, 0f);
        FugoUtils.ChangeAlpha(title, 0f);
        FugoUtils.ChangeAlpha(levelsBG.GetComponent <Image>(), 0f);
        FugoUtils.ChangeAlpha(bg, 0f);
        bigLevel.localScale = Vector3.zero;
        List <int> hiddenLevelsInSet = FugoUtils.GetHiddenLevelsInSet(set);

        CreateEmptyLevels(hiddenLevelsInSet);
        IEnumerator enumerator = levelHolder.GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                Transform level = (Transform)enumerator.Current;
                SetHiddenSetProperties(level, "locked", set);
            }
        }
        finally
        {
            IDisposable disposable;
            if ((disposable = (enumerator as IDisposable)) != null)
            {
                disposable.Dispose();
            }
        }
        int hiddenLevel = PlayerPrefsManager.GetHiddenLevel(int.Parse(set.SetID));
        int num         = 0;

        for (int i = 0; i < hiddenLevelsInSet.Count; i++)
        {
            num += hiddenLevelsInSet[i];
            if (num >= hiddenLevel)
            {
                currentSet = levelHolder.GetChild(i);
                break;
            }
        }
        int         num2        = 0;
        int         num3        = 1;
        IEnumerator enumerator2 = levelHolder.GetEnumerator();

        try
        {
            while (enumerator2.MoveNext())
            {
                Transform transform = (Transform)enumerator2.Current;
                if (transform == currentSet)
                {
                    SetHiddenSetProperties(transform, "current", set);
                    CreateEmptyBigStars(bigLevel, currentSet.Find("StarHolder").childCount);
                    bigLevel.Find("LevelText").GetComponent <Text>().text = currentSet.Find("LevelText").GetComponent <Text>().text;
                    StartCoroutine(AnimateCurrentLevel(transform, 0.5f));
                    break;
                }
                num3 += hiddenLevelsInSet[num2];
                SetHiddenSetProperties(transform, "completed", set);
                num2++;
            }
        }
        finally
        {
            IDisposable disposable2;
            if ((disposable2 = (enumerator2 as IDisposable)) != null)
            {
                disposable2.Dispose();
            }
        }
        PaintAllChilds(bigLevel.Find("StarHolder"), FugoUtils.HexToColor(set.NotCompletedLevelBGColor));
        bigLevel.Find("LevelText").GetComponent <Text>().color = FugoUtils.HexToColor(set.SelectedLevelNumberColor);
        bigLevel.GetComponent <Image>().color = FugoUtils.HexToColor(set.SelectedLevelBGColor);
        curLevelInGame = hiddenLevel - num3 + 1;
        for (int j = 0; j < hiddenLevel - num3; j++)
        {
            if (bigLevel.Find("StarHolder").childCount > j)
            {
                bigLevel.Find("StarHolder").GetChild(j).GetComponent <Image>()
                .color = FugoUtils.HexToColor(set.CompletedLevelBGColor);
            }
        }
        panel.gameObject.SetActive(value: true);
        StartCoroutine(AnimateSetScreen());
        if (currentSet == null)
        {
            CreateEmptyBigStars(bigLevel, hiddenLevelsInSet[hiddenLevelsInSet.Count - 1]);
            bigLevel.Find("LevelText").GetComponent <Text>().text = hiddenLevelsInSet.Count.ToString();
            PaintAllChilds(bigLevel.Find("StarHolder"), FugoUtils.HexToColor(set.CompletedLevelBGColor));
        }
    }