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); }
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); }
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); }