public void Show(int _numStars = 0) { Setup(); this.StopAllCoroutines(); ContinueScreen.Close(true); numStars = _numStars; this.gameObject.SetActive(true); foreach (EndgameStar star in Stars) { star.Reset(); } showTween.Restart(); this.gameObject.SetActive(true); GameResultUI.I.BonesCounter.Show(); GameResultUI.I.BonesCounter.DecreaseBy(_numStars); }
IEnumerator CO_Show(List <EndsessionResultData> _sessionData, int _alreadyUnlockedRewards) { yield return(null); SetRewardsGos(); // Show minigames Bar.Hide(); Minigames.Show(_sessionData); yield return(new WaitForSeconds(1)); // Show bar if (_alreadyUnlockedRewards > 2) { _alreadyUnlockedRewards = 2; } while (_alreadyUnlockedRewards > -1) { Bar.Achievements[_alreadyUnlockedRewards].AchieveReward(true, true); _alreadyUnlockedRewards--; } Bar.Show(_sessionData.Count * 3); GameResultUI.I.BonesCounter.Show(); while (!Bar.ShowTween.IsComplete()) { yield return(null); } // Start filling bar and/or show Continue button releasedMinigamesStars = Minigames.CloneStarsToMainPanel(); if (releasedMinigamesStars.Count > 0) { minigamesStarsToBarTween = DOTween.Sequence(); Vector2 to = Bar.GetComponent <RectTransform>().anchoredPosition; for (int i = 0; i < releasedMinigamesStars.Count; ++i) { RectTransform mgStar = releasedMinigamesStars[i]; minigamesStarsToBarTween.Insert(i * 0.2f, mgStar.DOAnchorPos(to, 0.3f).OnComplete(() => Bar.IncreaseBy(1))) .Join(mgStar.GetComponent <Image>().DOFade(0, 0.2f).SetDelay(0.1f).SetEase(Ease.InQuad)) .Join(mgStar.DORotate(new Vector3(0, 0, 180), 0.3f)); } yield return(new WaitForSeconds(minigamesStarsToBarTween.Duration())); } AudioManager.I.PlaySfx(SfxShowContinue); ContinueScreen.Show(Continue, ContinueScreenMode.Button); }
public void Hide(bool _immediate) { if (!setupDone) { return; } this.StopAllCoroutines(); ContinueScreen.Close(true); if (_immediate) { showTween.Rewind(); } else { showTween.PlayBackwards(); } }
IEnumerator StartReward() { // Wait for animation to complete //RewardsAnimator animator = this.GetComponent<RewardsAnimator>(); //while (!animator.IsComplete) // yield return null; yield return(new WaitForSeconds(3.5f)); /* FIRST CONTACT FEATURE */ if (AppManager.I.Player.IsFirstContact()) { KeeperManager.I.PlayDialog(Db.LocalizationDataId.Reward_Intro); // Clean and Charge antura reward. AnturaModelManager.Instance.ClearLoadedRewards(); RewardPack firstUnlockedReward = RewardSystemManager.GetFirstAnturaReward(RewardTypes.reward); AppManager.I.Player.AddRewardUnlocked(firstUnlockedReward); AnturaModelManager.Instance.LoadRewardPackOnAntura(firstUnlockedReward); } else { int rnd = Random.Range(1, 3); switch (rnd) { case 1: KeeperManager.I.PlayDialog(Db.LocalizationDataId.Reward_Big_1); break; case 3: KeeperManager.I.PlayDialog(Db.LocalizationDataId.Reward_Big_2); break; default: KeeperManager.I.PlayDialog(Db.LocalizationDataId.Reward_Big_3); break; } AnturaModelManager.Instance.ClearLoadedRewards(); RewardPack newUnlockedReward = RewardSystemManager.GetNextRewardPack()[0]; AppManager.I.Player.AddRewardUnlocked(newUnlockedReward); AnturaModelManager.Instance.LoadRewardPackOnAntura(newUnlockedReward); } /* --------------------- */ ContinueScreen.Show(Continue, ContinueScreenMode.Button); yield return(null); }
/// <summary> /// Immediately clears the GlobalUI elements /// </summary> /// <param name="includeSceneTransitioner">If TRUE (default) also clears the sceneTransitioner, otherwise not</param> public static void Clear(bool includeSceneTransitioner = true) { if (includeSceneTransitioner && SceneTransitioner != null) { SceneTransitioner.CloseImmediate(); } if (ContinueScreen != null) { ContinueScreen.Close(true); } if (WidgetPopupWindow != null) { WidgetPopupWindow.Close(true); } if (WidgetSubtitles != null) { WidgetSubtitles.Close(true); } }
public void Show(List <EndsessionResultData> _sessionData, int _alreadyUnlockedRewards, bool _immediate) { ContinueScreen.Close(true); Hide(true); Setup(); this.StopAllCoroutines(); if (_immediate) { showTween.Complete(); } else { showTween.Restart(); } godraysTween.Restart(); this.gameObject.SetActive(true); this.StartCoroutine(CO_Show(_sessionData, _alreadyUnlockedRewards)); }
IEnumerator CO_ShowComplete() { int id = 0; while (id < numStars) { Stars[id].Gain(); GameResultUI.I.BonesCounter.IncreaseByOne(); yield return(new WaitForSeconds(0.2f)); id++; } if (numStars > 0) { bgTween.Restart(); } AudioManager.I.PlaySfx(numStars > 0 ? SfxCompleteWithStars : SfxCompleteNoStars); ContinueScreen.Show(Continue, ContinueScreenMode.Button); }
public void Ready2Play() { WidgetSubtitles.I.Close(); AudioManager.I.PlaySfx(Sfx.GameTitle); ContinueScreen.Show(RestartGame, ContinueScreenMode.Button); }