public void CreateDailyGifts() { giftClicked = false; rewardBG.GetComponent <Image>().color = new Color(1f, 1f, 1f, 0f); rewardBG.gameObject.SetActive(value: false); congratzText.GetComponent <Text>().color = FugoUtils.HexToColor("FFFFFF00"); rewardAmountText.GetComponent <Text>().color = FugoUtils.HexToColor("FFFFFF00"); rewardHintText.GetComponent <Text>().color = FugoUtils.HexToColor("FFFFFF00"); rewardAmountText.Find("CoinImage").GetComponent <Image>().color = FugoUtils.HexToColor("FFFFFF00"); proBadge.transform.Find("Text").GetComponent <Text>().color = FugoUtils.HexToColor("FFFFFF00"); proBadge.transform.GetComponent <Image>().color = FugoUtils.HexToColor("FFFFFF00"); proBadge.gameObject.SetActive(value: false); rewardedButton.gameObject.SetActive(value: false); Transform[] array = places; foreach (Transform transform in array) { if (transform.childCount > 0) { UnityEngine.Object.Destroy(transform.GetChild(0).gameObject); } } FugoUtils.ShuffleArray(indexes); FugoUtils.ShuffleArray(places); FugoUtils.ShuffleArray(gifts); reward = gifts[0]; if (reward == 0) { DateTime dateTime = DateTime.Now.AddHours(1.0); if (PlayerPrefsManager.GetPro()) { dateTime = dateTime.AddHours(1.0); } PlayerPrefsManager.SetHintDiscountTime(dateTime.ToString()); rewardHintText.gameObject.SetActive(value: true); } else { rewardAmountText.GetComponent <Text>().text = "+" + reward; rewardAmountText.gameObject.SetActive(value: true); } int[] array2 = indexes; foreach (int num in array2) { int num2 = num; if (num == 3) { num2 = 2; } Transform go = UnityEngine.Object.Instantiate(giftPrefab, places[num2]).transform; go.localScale = Vector3.one; go.Find("Top").GetComponent <Image>().sprite = tops[num]; go.Find("Bottom").GetComponent <Image>().sprite = bottoms[num]; go.GetComponent <Button>().onClick.AddListener(delegate { GiftClicked(go); }); StartCoroutine(BoxAnimThread(go)); } ArrangeCollectButtons(); }
public void endGame() { if (!WheelController.running) { } sphere.SetActive(value: true); star.transform.Find("Plus").GetComponent <Button>().enabled = false; end.transform.SetAsLastSibling(); shopPopUp.transform.parent.SetAsLastSibling(); WheelController.instance.wordContiner.SetActive(value: false); end.transform.Find("LogoNStuff/Progress/ProgressText").GetComponent <Text>().text = BoardController.set.SetFullName + " " + (BoardController.instance.info[2] + 1) + "/" + BoardController.set.levels.Count; end.transform.Find("LogoNStuff/Progress/Start/Text").GetComponent <Text>().text = BoardController.set.SetName; hideButtons(); end.transform.Find("NiceText").GetComponent <Image>().color = FugoUtils.HexToColor(BoardController.set.InGameRibbonColor); end.transform.Find("NiceText/Text").GetComponent <Text>().text = ribbonWords[UnityEngine.Random.Range(0, ribbonWords.Length - 1)]; UnityEngine.Debug.Log("is it daily? " + BoardController.daily); if (BoardController.daily) { PlayerPrefsManager.ResetContinueDaily(); } else if (BoardController.levelToOpen == -1) { PlayerPrefsManager.ResetContinue(); } }
public void checkRibbon() { int[] levelInfo = FugoUtils.getLevelInfo(); if (GameController.endType == EndType.Level || GameController.endType == EndType.Hidden) { return; } Movements.instance.executeWithDelay((Movements.Execute)SoundManager.instance.playPop2, 0.5f); ribbon.SetActive(value: true); GameObject gameObject = ribbon.transform.Find("LevelName").gameObject; if (UISwapper.flipGame) { ArabicText arabicText = gameObject.GetComponent <ArabicText>(); if (arabicText == null) { arabicText = gameObject.AddComponent <ArabicText>(); } arabicText.Text = AutoLanguage.dict["SetCompleteText"].Replace("%@%", GameController.set.SetFullName.ToUpper()); } else { ribbon.transform.Find("LevelName").GetComponent <Text>().text = AutoLanguage.dict["SetCompleteText"].Replace("%@%", GameController.set.SetFullName.ToUpper()); } ribbon.GetComponent <Image>().color = FugoUtils.HexToColor(GameController.section.FirstSetColor); Movements.instance.scale(ribbon, Vector3.zero, Vector3.one, 0.5f); }
private void SetLevelProperties(Transform t, LevelSet set, string status) { t.GetComponent <Button>().onClick.AddListener(delegate { SetOnClick(t); }); if (status == "current") { t.Find("BGHolder/Circle").GetComponent <Image>().color = FugoUtils.HexToColor(set.SelectedLevelBGColor); t.Find("BGHolder/Circle").GetComponent <Image>().sprite = currentLevelBGSprite; t.Find("BGHolder/Frame").GetComponent <Image>().color = FugoUtils.HexToColor(set.SelectedLevelBGColor); t.Find("BGHolder/Frame").gameObject.SetActive(value: true); t.Find("TextHolder/NumberText").GetComponent <Text>().color = FugoUtils.HexToColor(set.SelectedLevelNumberColor); t.GetComponent <SetScript>().scale = Vector3.one * 1.1f; anim = StartCoroutine(AnimateCurrentLevel(t, 1f)); t.GetComponent <Button>().interactable = true; } else if (status == "locked") { t.GetComponent <Button>().interactable = false; t.Find("BGHolder/Circle").GetComponent <Image>().color = FugoUtils.HexToColor(set.NotCompletedLevelBGColor); t.Find("TextHolder/NumberText").GetComponent <Text>().color = FugoUtils.HexToColor(set.NotCompletedLevelNumberColor); t.GetComponent <SetScript>().scale = Vector3.one; } else if (status == "completed") { t.Find("BGHolder/Circle").GetComponent <Image>().color = FugoUtils.HexToColor(set.CompletedLevelBGColor); t.Find("TextHolder/NumberText").GetComponent <Text>().color = FugoUtils.HexToColor(set.CompletedLevelNumberColor); t.GetComponent <SetScript>().scale = Vector3.one; t.GetComponent <Button>().interactable = true; } }
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 Init() { if (langHolder.childCount == 0) { CreateLangButtons(); } if (PlayerPrefsManager.GetLang() == string.Empty) { if (SystemLanguageInList(Application.systemLanguage.ToString())) { PlayerPrefsManager.SetLang(Application.systemLanguage.ToString()); } else { PlayerPrefsManager.SetLang(SystemLanguage.English.ToString()); } } LanguageScript.ParseStrings(); if (PlayerPrefsManager.GetLang() == "Hebrew") { UnityEngine.Object.Destroy(title.GetComponent <ArabicText>()); UnityEngine.Object.Destroy(button.GetComponent <ArabicText>()); } title.text = LanguageScript.SelectLanguageText; button.text = LanguageScript.PlayTextFixed; IEnumerator enumerator = buttonHolder.GetEnumerator(); try { while (enumerator.MoveNext()) { Transform transform = (Transform)enumerator.Current; transform.Find("Frame").gameObject.SetActive(value: false); transform.Find("Text").GetComponent <Text>().color = Color.white; if (transform.name.ToLower() == PlayerPrefsManager.GetLang().ToLower()) { transform.Find("Frame").gameObject.SetActive(value: true); transform.Find("Text").GetComponent <Text>().color = FugoUtils.HexToColor("09FF15"); transform.Find("Frame").GetComponent <Image>().color = FugoUtils.HexToColor("09FF15"); } } } finally { IDisposable disposable; if ((disposable = (enumerator as IDisposable)) != null) { disposable.Dispose(); } } }
private void Awake() { instance = this; start = base.transform.Find("Start").localPosition; end = base.transform.Find("End").localPosition; bar = base.transform.Find("Bar"); bar.GetComponent <Image>().color = FugoUtils.HexToColor(BoardController.set.InGameSelectedLetterBGColor); parent = base.transform.parent; grandparent = parent.parent; parentStart = grandparent.Find("End"); parentEnd = grandparent.Find("Start"); animTime = 0.5f; steps = FugoUtils.extraPerCoin; }
public void popRibbon() { UnityEngine.Object.Destroy(randomRibbon); UnityEngine.Random.InitState(DateTime.UtcNow.Millisecond); randomRibbon = UnityEngine.Object.Instantiate(ribbonPrefab); randomRibbon.transform.Find("Text").GetComponent <Text>().text = ribbonWords[UnityEngine.Random.Range(0, ribbonWords.Length)]; randomRibbon.GetComponent <Image>().color = FugoUtils.HexToColor(BoardController.set.InGameRibbonColor); UnityEngine.Debug.Log("in game ribbon color " + BoardController.set.InGameRibbonColor); randomRibbon.transform.SetParent(end.transform.parent); randomRibbon.transform.localPosition = Vector3.zero; randomRibbon.transform.localScale = Vector3.zero; Movements.instance.scale(randomRibbon, 1f, 0.2f); Movements.instance.executeWithDelay((Movements.Execute)disableRibbon, 0.5f); }
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); }
public void spawnExtra() { GameObject gameObject = UnityEngine.Object.Instantiate(textAnim); gameObject.GetComponent <Text>().text = newExtra; gameObject.GetComponent <Text>().color = FugoUtils.HexToColor(BoardController.set.InGameSelectedLetterColor); gameObject.transform.parent = base.transform; gameObject.transform.position = wordContiner.transform.position; ExtraWord component = gameObject.GetComponent <ExtraWord>(); component.transform.localScale = Vector3.one; component.start = gameObject.transform.position; component.end = starButton.transform.position; component.startMove(); checkExtraCoin(); }
private void setColors() { InGameSelectedLetterColor = FugoUtils.HexToColor(set.InGameSelectedLetterColor); SelectedLetterBGColor = FugoUtils.HexToColor(set.InGameSelectedLetterBGColor); InGameLetterColor = FugoUtils.HexToColor(set.InGameLetterColor); if (section.FirstSetColor != null) { FirstSetColor = FugoUtils.HexToColor(section.FirstSetColor); } TileColor = FugoUtils.HexToColor(set.InGameTileColor); WheelColor = FugoUtils.HexToColor(set.InGameCircleColor); HeaderColor = FugoUtils.HexToColor(set.InGameHeaderColor); RibbonColor = FugoUtils.HexToColor(set.InGameRibbonColor); WheelStrokeColor = FugoUtils.Color(253, 181, 47); if (PlayerPrefsManager.IsBlueMode() && PlayerPrefsManager.GetInGameLetterColor() != string.Empty) { SelectedLetterBGColor = FugoUtils.HexToColor(PlayerPrefsManager.GetInGameLetterColor()); } }
public void getHint() { int num = UnityEngine.Random.Range(0, level.width); int num2 = UnityEngine.Random.Range(0, level.height); GameObject gameObject = board[num, num2]; if (gameObject == null) { getHint(); } else if (gameObject.activeSelf && !gameObject.transform.Find("BG/Text").gameObject.activeSelf&& gameObject.transform.Find("BG").GetChild(0).name != "DailyStar(Clone)") { GameObject gameObject2 = gameObject.transform.Find("BG/Text").gameObject; gameObject.transform.Find("BG/Text").gameObject.SetActive(value: true); gameObject2.GetComponent <Text>().color = FugoUtils.HexToColor(set.InGameHintColor); Movements.instance.move(gameObject2, GameAnimController.instance.hint.transform.Find("Hint/Image").transform.position, gameObject2.transform.position, 0.3f); Movements.instance.scale(gameObject2, 2f, 0.25f); Movements.instance.scale(gameObject2, Vector3.one * 2f, Vector3.one, 0.25f, 0.25f); gameObject.transform.Find("BG/Coin").gameObject.SetActive(value: false); PlayerPrefsManager.SetCoin(PlayerPrefsManager.GetCoin() - PlayerPrefsManager.GetHintPrice()); cointText.GetComponent <Text>().text = PlayerPrefsManager.GetCoin().ToString(); SoundManager.instance.PlayHint(); TutorialController.freeHint = false; if (!daily) { PlayerPrefsManager.UseProHint(); } if (daily) { PlayerPrefsManager.AddHintDaily(num, num2); } else { PlayerPrefsManager.AddHint(num, num2); } GameMenuController.instance.updateHintPrice(); } else { getHint(); } }
private void SetHiddenSetProperties(Transform level, string type, LevelSet set) { if (type == "locked") { level.Find("Locked").gameObject.SetActive(value: true); level.Find("StarHolder").gameObject.SetActive(value: false); level.Find("Locked").GetComponent <Image>().color = FugoUtils.HexToColor(set.CompletedLevelBGColor); level.Find("Locked/Image").GetComponent <Image>().color = FugoUtils.HexToColor(set.NotCompletedLevelNumberColor); level.GetComponent <Button>().onClick.RemoveAllListeners(); } else if (type == "current") { level.Find("Locked").gameObject.SetActive(value: false); level.Find("StarHolder").gameObject.SetActive(value: false); level.GetComponent <Image>().color = FugoUtils.HexToColor(set.SelectedLevelBGColor); level.GetComponent <Image>().sprite = currentLevelBGSprite; level.Find("LevelText").GetComponent <Text>().color = FugoUtils.HexToColor(set.SelectedLevelNumberColor); level.GetComponent <Button>().onClick.AddListener(delegate { HiddenSetOnClick(level, set, isCurrent: true); }); bigLevel.GetComponent <Button>().onClick.RemoveAllListeners(); bigLevel.GetComponent <Button>().onClick.AddListener(delegate { HiddenSetOnClick(level, set, isCurrent: true); }); } else if (type == "completed") { level.Find("StarHolder").gameObject.SetActive(value: true); level.Find("Locked").gameObject.SetActive(value: false); level.GetComponent <Image>().color = FugoUtils.HexToColor(set.CompletedLevelBGColor); level.Find("LevelText").GetComponent <Text>().color = FugoUtils.HexToColor(set.CompletedLevelNumberColor); PaintAllChilds(level.Find("StarHolder"), FugoUtils.HexToColor(set.CompletedLevelLetterColor)); level.GetComponent <Button>().onClick.AddListener(delegate { HiddenSetOnClick(level, set); }); } }
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)); } }
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 CreateSlices() { IEnumerator enumerator = sliceHolder.GetEnumerator(); try { while (enumerator.MoveNext()) { Transform transform = (Transform)enumerator.Current; UnityEngine.Object.Destroy(transform.gameObject); } } finally { IDisposable disposable; if ((disposable = (enumerator as IDisposable)) != null) { disposable.Dispose(); } } float num = 0f; for (int i = 0; i < percentages.Length; i++) { Transform transform2 = UnityEngine.Object.Instantiate(slicePrefab, sliceHolder).transform; transform2.localScale = Vector3.one; transform2.name = i.ToString(); transform2.GetComponent <Image>().fillAmount = (float)percentages[i] / 360f; transform2.localRotation = Quaternion.Euler(0f, 0f, 360f - num); transform2.GetComponent <Image>().color = FugoUtils.HexToColor(colors[i]); num += (float)percentages[i]; transform2.Find("PrizeHolder").localRotation = Quaternion.Euler(0f, 0f, (float)(-percentages[i]) / 2f); transform2.Find("PrizeHolder").localPosition = new Vector3(Mathf.Sin((float)percentages[i] / 2f * ((float)Math.PI / 180f)), Mathf.Cos((float)percentages[i] / 2f * ((float)Math.PI / 180f)), 0f) * 105f; transform2.Find("PrizeHolder/AmountText").GetComponent <Text>().text = Mathf.Abs(prizes[i]).ToString(); if (prizes[i] > 0) { transform2.Find("PrizeHolder/CoinHolder").gameObject.SetActive(value: true); transform2.Find("PrizeHolder/HintHolder").gameObject.SetActive(value: false); transform2.Find("PrizeHolder/GiftHolder").gameObject.SetActive(value: false); } else if (prizes[i] < 0) { transform2.Find("PrizeHolder/CoinHolder").gameObject.SetActive(value: false); transform2.Find("PrizeHolder/AmountText").gameObject.SetActive(value: false); transform2.Find("PrizeHolder/HintHolder").gameObject.SetActive(value: true); transform2.Find("PrizeHolder/GiftHolder").gameObject.SetActive(value: false); transform2.Find("PrizeHolder/HintHolder").localPosition = new Vector3(0f, 67f, 0f); } else { transform2.Find("PrizeHolder/GiftHolder").gameObject.SetActive(value: true); transform2.Find("PrizeHolder/CoinHolder").gameObject.SetActive(value: true); transform2.Find("PrizeHolder/AmountText").gameObject.SetActive(value: true); transform2.Find("PrizeHolder/AmountText").GetComponent <Text>().text = "100"; transform2.Find("PrizeHolder/HintHolder").gameObject.SetActive(value: false); transform2.Find("PrizeHolder/AmountText").localPosition = new Vector3(0f, 16f, 0f); transform2.Find("PrizeHolder/AmountText").GetComponent <Text>().resizeTextForBestFit = false; transform2.Find("PrizeHolder/AmountText").GetComponent <Text>().fontSize = 30; transform2.Find("PrizeHolder/CoinHolder").localPosition = new Vector3(0f, -24f, 0f); transform2.Find("PrizeHolder/CoinHolder").localScale = Vector3.one * 0.8f; transform2.Find("Pattern").gameObject.SetActive(value: true); transform2.GetComponent <Image>().color = FugoUtils.HexToColor("3C00FF"); } ArabicController.MakeArabicMenu(transform2); } AnimateBG(); SetCoinText(); SetSpinButton(); }
public static GameObject getLevel(int level) { GameObject original = Resources.Load <GameObject>("Prefabs/BoardTemplate"); GameObject original2 = Resources.Load <GameObject>("Prefabs/DebugCell"); int[] levelInfo = FugoUtils.getLevelInfo(level); Section section = Games.sections[levelInfo[0]]; LevelSet levelSet = section.sets[levelInfo[1]]; Level level2 = levelSet.levels[levelInfo[2]]; float num = FugoUtils.boardHeight; float num2 = num * FugoUtils.getBoardRatio(); GameObject gameObject = UnityEngine.Object.Instantiate(original); Transform transform = gameObject.transform.Find("Board"); float val = 7.5f / (float)level2.width; float val2 = num / 100f / (float)level2.height; float num3 = Math.Min(val, val2); float num4 = 100f * num3; float val3 = num2 / (float)level2.width; float val4 = num / (float)level2.height; num4 = Math.Min(val3, val4); float num5 = num2 - (float)level2.width * num4; float num6 = num - (float)level2.height * num4; UnityEngine.Debug.Log(num + " " + level2.height + " " + cellSize); num5 *= 0.5f; num6 *= 0.5f; RectTransform component = transform.GetComponent <RectTransform>(); UnityEngine.Debug.Log("board size " + component.sizeDelta); Vector2 sizeDelta = component.sizeDelta; sizeDelta.y = FugoUtils.adBoardHeight; component.sizeDelta = sizeDelta; Vector2 anchoredPosition = component.anchoredPosition; anchoredPosition.y = -100f; component.anchoredPosition = anchoredPosition; List <Word> words = level2.words; foreach (Word item in words) { int length = item.length; int x = item.X; int y = item.Y; for (int i = 0; i < length; i++) { GameObject gameObject2 = UnityEngine.Object.Instantiate(original2); gameObject2.GetComponent <Image>().color = FugoUtils.HexToColor(levelSet.InGameSelectedLetterBGColor); gameObject2.transform.Find("Text").GetComponent <Text>().color = FugoUtils.HexToColor(levelSet.InGameSelectedLetterColor); gameObject2.transform.Find("Text").GetComponent <Text>().text = item.word[i].ToString(); RectTransform component2 = gameObject2.GetComponent <RectTransform>(); gameObject2.transform.SetParent(transform.transform); component2.anchorMin = Vector2.up; component2.anchorMax = Vector2.up; component2.pivot = Vector2.up; component2.sizeDelta = Vector2.one * num4; component2.anchoredPosition = Vector2.right * x * num4 + Vector2.down * y * num4; component2.anchoredPosition += Vector2.down * num6 + Vector2.right * num5; if (item.orientation == Orientation.HORIZONTAL) { component2.anchoredPosition += Vector2.right * i * num4; } else { component2.anchoredPosition += Vector2.down * i * num4; } gameObject2.transform.localScale = Vector3.one; } } return(gameObject); }
public void newGame() { updateExtraCount(); locked = false; running = true; foundWords = new List <Word>(); words = new List <Word>(); extras = new List <string>(); foundExtras = new List <string>(); level = BoardController.level; foreach (Word word2 in level.words) { words.Add(word2); } string[] otherWords = level.otherWords; foreach (string item in otherWords) { extras.Add(item); } letterColor = FugoUtils.HexToColor(BoardController.set.InGameLetterColor); selectedLetterColor = FugoUtils.HexToColor(BoardController.set.InGameSelectedLetterColor); gameColor = FugoUtils.HexToColor(BoardController.set.TitleColor); selectedLetterBGColor = FugoUtils.HexToColor(BoardController.set.InGameSelectedLetterBGColor); wordText = wordUI.GetComponent <Text>(); word = string.Empty; letterlist = new List <Letter>(); float num = 360f / (float)level.letters.Length; positions = new Vector3[level.letters.Length]; letterContainer.parent.localScale = Vector3.zero; letterScale = 1f; if (level.letters.Length > 4) { letterScale = 4.5f / (float)level.letters.Length; range = 140f + (1f - letterScale) * BoardController.cellSize * 0.75f; if (SafeAreaScaler.scale < 1f) { range *= SafeAreaScaler.scale * 1.2f; letterScale *= SafeAreaScaler.scale * 1.2f; } } else { letterScale = 1f; range = 140f; if (SafeAreaScaler.scale < 1f) { letterScale *= SafeAreaScaler.scale; } } string text = "preferences failed"; try { text = PlayerPrefs.GetString("found_words", string.Empty); } catch (Exception) { } try { loadGame(); } catch (Exception ex2) { UnityEngine.Debug.Log("load game fail: " + ex2.ToString()); } calculateRange(); range *= 0.965f; for (int j = 0; j < level.letters.Length; j++) { GameObject gameObject = UnityEngine.Object.Instantiate(letterTemp); gameObject.GetComponent <RectTransform>().sizeDelta = Vector2.one * letterSize; positions[j].x = range * Mathf.Sin(num * (float)j * (float)Math.PI / 180f); positions[j].y = range * Mathf.Cos(num * (float)j * (float)Math.PI / 180f); positions[j].y += 3f; positions[j].z = 0f; gameObject.transform.parent = letterContainer; gameObject.transform.localScale = Vector3.one; gameObject.transform.localPosition = positions[j]; gameObject.GetComponent <Letter>().setLetter(level.letters[j].ToString()); gameObject.transform.Find("Text").GetComponent <Text>().color = letterColor; } Color color = FugoUtils.HexToColor(BoardController.set.InGameCircleColor); GetComponent <Image>().color = color; if (PlayerPrefsManager.GetLevel() != 1) { UnityEngine.Object.Destroy(GetComponent <GraphicRaycaster>()); UnityEngine.Object.Destroy(GetComponent <Canvas>()); } try { killCells(); } catch (Exception) { } }
private void loadGame() { if (BoardController.levelToOpen != -1) { return; } List <string> list = null; int[,] array = null; if (!BoardController.daily) { if (BoardController.levelToOpen == -1) { list = PlayerPrefsManager.getFoundWords(); foundExtras = PlayerPrefsManager.getFoundExtras(); array = PlayerPrefsManager.GetHints(); } } else { list = PlayerPrefsManager.getFoundWordsDaily(); foundExtras = PlayerPrefsManager.getFoundExtrasDaily(); array = PlayerPrefsManager.GetHintsDaily(); } Color hintColor = FugoUtils.HexToColor(BoardController.set.InGameHintColor); for (int i = 0; i < array.GetLength(0); i++) { try { BoardController.instance.board[array[i, 0], array[i, 1]].GetComponent <Cell>().enableHint(hintColor); } catch (Exception) { } } foreach (string item in list) { } for (int j = 0; j < list.Count; j++) { for (int k = 0; k < words.Count; k++) { string text = list[j]; Word word = words[k]; if (!(text == string.Empty) && word.word == text) { word.enableWord(); words.Remove(word); foundWords.Add(word); k--; } } } for (int l = 0; l < foundExtras.Count; l++) { for (int m = 0; m < extras.Count; m++) { string text2 = foundExtras[l]; string text3 = extras[m]; if (!(text2 == string.Empty) && text3 == text2) { extras.Remove(text3); m--; GameObject gameObject = UnityEngine.Object.Instantiate(extraPrefab); gameObject.transform.parent = extraWordContainer.transform; gameObject.transform.localScale = Vector3.one; gameObject.transform.Find("Word").GetComponent <Text>().text = text3; } } } }
public void CreateShopItems() { IEnumerator enumerator = list.GetEnumerator(); try { while (enumerator.MoveNext()) { Transform transform = (Transform)enumerator.Current; UnityEngine.Object.Destroy(transform.gameObject); } } finally { IDisposable disposable; if ((disposable = (enumerator as IDisposable)) != null) { disposable.Dispose(); } } Vector3 zero = Vector3.zero; int[] array = order; foreach (int num in array) { Transform t = UnityEngine.Object.Instantiate(shopItemPrefab, list).transform; t.localPosition = zero; t.localScale = Vector3.one; t.Find("ShopImage").GetComponent <Image>().sprite = shopImages[num]; t.Find("TitleText").GetComponent <Text>().text = titles[num]; t.Find("DescText").GetComponent <Text>().text = descs[num]; t.Find("BuyButton").GetComponent <Button>().onClick.AddListener(delegate { ButtonCallback(t.Find("TitleText").GetComponent <Text>().text); }); t.Find("BuyButton/Text").GetComponent <Text>().text = itemPrices[num]; if (num % 2 == 1) { t.GetComponent <Image>().color = FugoUtils.HexToColor("96969636"); } if (num == 3) { t.Find("BadgeImage").GetComponent <Image>().sprite = badges[0]; t.Find("BadgeImage/Text").GetComponent <Text>().text = badgeTexts[0]; t.Find("BadgeImage").gameObject.SetActive(value: true); if (UISwapper.flipGame) { t.Find("BadgeImage").GetComponent <RectTransform>().anchoredPosition = Vector2.left * 70f + Vector2.up * 23.4f; } } if (num == 5) { t.Find("BadgeImage").GetComponent <Image>().sprite = badges[1]; t.Find("BadgeImage/Text").GetComponent <Text>().text = badgeTexts[1]; t.Find("BadgeImage").gameObject.SetActive(value: true); if (UISwapper.flipGame) { t.Find("BadgeImage").GetComponent <RectTransform>().anchoredPosition = Vector2.left * 70f + Vector2.up * 23.4f; } } if (num == 6) { t.Find("BadgeImage").GetComponent <Image>().sprite = badges[2]; t.Find("BadgeImage/Text").GetComponent <Text>().text = badgeTexts[2]; t.Find("BadgeImage").gameObject.SetActive(value: true); t.Find("BuyButton/Text").GetComponent <Text>().text = LanguageScript.BecomeProText; if (UISwapper.flipGame) { t.Find("BadgeImage").GetComponent <RectTransform>().anchoredPosition = Vector2.left * 70f + Vector2.up * 23.4f; } } zero.y -= 120f; if (PlayerPrefsManager.GetLang() == "Hebrew") { ArabicController.MakeArabicMenu(t); } } if (UISwapper.flipGame) { Text[] allComponents = list.GetAllComponents <Text>(); Text[] array2 = allComponents; foreach (Text text in array2) { Vector3 localScale = text.transform.localScale; localScale.x *= -1f; text.transform.localScale = localScale; string text2 = text.text; ArabicText arabicText = text.gameObject.AddComponent <ArabicText>(); arabicText.Text = text2; } } if (SceneManager.GetActiveScene().name == "Menu") { GameObject gameObject = GameObject.Find("Canvas"); gameObject.transform.Find("PopupHolder/ProPopup/ProButton/PriceText").GetComponent <Text>().text = itemPrices[6] + " / " + LanguageScript.WeeklyText; gameObject.transform.Find("PopupHolder/ProPopup/DescriptionText").GetComponent <Text>().text = LanguageScript.ProContentText.Replace("%@", itemPrices[6]); gameObject.transform.Find("PopupHolder/TrialProPopup/ProButton/PriceText").GetComponent <Text>().text = LanguageScript.FreeTrialText.Replace("%@", itemPrices[7]); gameObject.transform.Find("PopupHolder/TrialProPopup/DescriptionText").GetComponent <Text>().text = LanguageScript.ProContentText.Replace("%@", itemPrices[7]); if (PlayerPrefsManager.GetPro()) { gameObject.transform.Find("PopupHolder/ProPopup/ProButton/PriceText").GetComponent <Text>().text = LanguageScript.AlreadyPurchasedText; gameObject.transform.Find("PopupHolder/ProPopup/ProButton/PriceText").GetComponent <Text>().color = Color.white; gameObject.transform.Find("PopupHolder/ProPopup/ProButton").GetComponent <Button>().interactable = false; gameObject.transform.Find("PopupHolder/ProPopup/DescriptionText").GetComponent <Text>().text = LanguageScript.ProContentText.Replace("%@", itemPrices[6]); gameObject.transform.Find("PopupHolder/TrialProPopup/ProButton/PriceText").GetComponent <Text>().text = LanguageScript.AlreadyPurchasedText; gameObject.transform.Find("PopupHolder/TrialProPopup/ProButton/PriceText").GetComponent <Text>().color = Color.white; gameObject.transform.Find("PopupHolder/TrialProPopup/ProButton").GetComponent <Button>().interactable = false; gameObject.transform.Find("PopupHolder/TrialProPopup/DescriptionText").GetComponent <Text>().text = LanguageScript.ProContentText.Replace("%@", itemPrices[7]); } } else { GameObject.Find("Canvas").transform.Find("Enviroment/ShopHolder/ProPopup/ProButton/PriceText").GetComponent <Text>().SetText(itemPrices[6] + " / " + LanguageScript.WeeklyText); GameObject.Find("Canvas").transform.Find("Enviroment/ShopHolder/ProPopup/DescriptionText").GetComponent <Text>().SetText(LanguageScript.ProContentText.Replace("%@", itemPrices[6])); GameObject gameObject2 = GameObject.Find("Canvas").transform.Find("Enviroment/ShopHolder/ProPopup/DescriptionText").gameObject; gameObject2.GetComponent <Text>().SetText(LanguageScript.ProContentText.Replace("%@", itemPrices[6])); if (PlayerPrefsManager.GetPro()) { GameObject.Find("Canvas").transform.Find("Enviroment/ShopHolder/ProPopup/ProButton/PriceText").GetComponent <Text>().SetText(LanguageScript.AlreadyPurchasedText); GameObject.Find("Canvas").transform.Find("Enviroment/ShopHolder/ProPopup/ProButton/PriceText").GetComponent <Text>().color = Color.white; GameObject.Find("Canvas").transform.Find("Enviroment/ShopHolder/ProPopup/ProButton").GetComponent <Button>().interactable = false; GameObject.Find("Canvas").transform.Find("Enviroment/ShopHolder/ProPopup/DescriptionText").GetComponent <Text>().SetText(LanguageScript.ProContentText.Replace("%@", itemPrices[6])); LanguageScript.ProContentText.Replace("%@", itemPrices[6]); } GameObject.Find("Canvas").transform.Find("Enviroment/ShopHolder/ProPopup/BG/HintText").GetComponent <Text>().SetText(LanguageScript.ProFreeHintText); GameObject.Find("Canvas").transform.Find("Enviroment/ShopHolder/ProPopup/BG/NoAdText").GetComponent <Text>().SetText(LanguageScript.ProNoAdText); GameObject.Find("Canvas").transform.Find("Enviroment/ShopHolder/ProPopup/BG/GiftText").GetComponent <Text>().SetText(LanguageScript.ProDoubleDailyText); GameObject.Find("Canvas").transform.Find("Enviroment/ShopHolder/ProPopup/Terms&Conditions").GetComponent <Text>().SetText(LanguageScript.PrivacyPolicyText); } }