private void Reset(LevelType aLevelType, int aPackIndex) { background.Reset(aLevelType, aPackIndex); board.Reset(); ladybug.Reset(); levelText.Reset(); categoryText.Reset(); backButton.Reset(); shopButton.Reset(); extraWordsButton.Reset(); perfectMeter.Reset(); timeMeter.Reset(); goodStartButton.Reset(); startAndFinishButton.Reset(); exposeButton.Reset(); tipButton.Reset(); tipText.Reset(); specialWelcome.Reset(); coinPod.Reset(); level = null; pack = null; int num; switch (aLevelType) { default: num = 0; break; case LevelType.DailyPuzzle: num = 6; break; case LevelType.BonusRound: num = 4; break; case LevelType.Normal: num = 0; break; } state = (State)num; delay = 0f; isLevelCompleted = false; isLastLevelInPack = false; isPerfect = false; specialLevelRound = 0; isMusicPlaying = false; IsReplayAvailable = true; }
public new void ShowWindow() { foreach (Transform item in stickerPad.transform) { item.gameObject.SetActive(value: false); UnityEngine.Object.Destroy(item.gameObject); } StickerMainMenu.Reset(); for (int i = 0; i < 20; i++) { Object.Instantiate(stickerPrefab, stickerPad.transform); } base.ShowWindow(); shopButton.Reset(); dailyBonusButton.Reset(); ShareUpdate(); RateUsUpdate(); if (ELSingleton <ELCanvas> .Instance.CanvasRatio == ELCanvas.Ratio.iPad) { centerSection.localScale = new Vector3(0.8f, 0.8f, 0.8f); } if (ELSingleton <ELCanvas> .Instance.CanvasRatio == ELCanvas.Ratio.iPhone) { centerSection.localScale = new Vector3(0.9f, 0.9f, 0.9f); } wordsText.text = string.Concat(ELSingleton <PointsManager> .Instance.Points); float num = 0f; Component[] componentsInChildren = base.gameObject.GetComponentsInChildren <CommonButton>(); componentsInChildren = componentsInChildren; for (int j = 0; j < componentsInChildren.Length; j++) { ((CommonButton)componentsInChildren[j]).Show(num); num += 0.1f; } if (ELSingleton <ApplicationSettings> .Instance.DeploymentSettings.isDebug) { versionText.text = $"v{Application.version} {ELSingleton<ELCanvas>.Instance.CanvasRatio}"; } else { versionText.gameObject.SetActive(value: false); } Screen.sleepTimeout = -2; }
public void ShowWindow(LevelInfo aLevelInfo, AnimationState state = AnimationState.ANIMATION_STATE_NONE) { CancelInvoke(); ShowWindow(); UpdateAnimation(state); shopButton.Reset(); foreach (Transform item in content.transform) { item.gameObject.SetActive(value: false); UnityEngine.Object.Destroy(item.gameObject); } packItemList = new List <PackItem>(); int num = 0; float num2 = 0f; for (int i = 0; i < ELSingleton <LevelsSettings> .Instance.levelSet.worlds.Count; i++) { for (int j = 0; j < ELSingleton <LevelsSettings> .Instance.levelSet.worlds[i].packs.Count; j++) { aLevelInfo.currentWorld = i; aLevelInfo.currentPack = j; PackItem packItem = Object.Instantiate(packItemPrefab, content.transform); num2 = Mathf.Max(packItem.Prepare(aLevelInfo, num, state), num2); if (packItem.IsUnlocked || ELSingleton <ApplicationSettings> .Instance.DeploymentSettings.isCheatsEnabled) { packItem.OnFocus.AddListener(delegate { Focus(aLevelInfo); }); } packItemList.Add(packItem); num++; } } float y = UpdateLayout() + 850f; RectTransform component = content.GetComponent <RectTransform>(); component.sizeDelta = new Vector2(component.sizeDelta.x, y); scrollRect.verticalNormalizedPosition = 0f; lastPackCompleted = true; for (int k = 0; k < packItemList.Count; k++) { PackItem packItem2 = packItemList[k]; if (packItem2.IsCurrent) { if (k > 0) { packToComplete = packItemList[k - 1]; } packToUnlock = packItem2; scrollRect.verticalNormalizedPosition = packItem2.normalizedScrollLocation; if (state == AnimationState.ANIMATION_STATE_PACK_WAIT) { scrollRect.verticalNormalizedPosition = packToComplete.normalizedScrollLocation; } lastPackCompleted = false; } } if (state == AnimationState.ANIMATION_STATE_PACK_WAIT) { shopButton.UpdateCoins(-ELSingleton <XmlSettings> .Instance.coinsConfig.pack); Invoke("AnimationWellDoneInvoke", num2 + 0.5f); Invoke("AnimationWellDoneInvokeSfx", num2 + 0.4f); } if (state == AnimationState.ANIMATION_STATE_NONE && lastPackCompleted) { packItemList[packItemList.Count - 1].OpenAfterComplete(); } float num3 = 0f; Component[] componentsInChildren = base.gameObject.GetComponentsInChildren <CommonButton>(); componentsInChildren = componentsInChildren; for (int l = 0; l < componentsInChildren.Length; l++) { ((CommonButton)componentsInChildren[l]).Show(num3); num3 += 0.1f; } Screen.sleepTimeout = -2; }