public override void Init(DRewardPopupScreen screenData, RewardPopupController popupController) { this.screenData = (DRewardPopupScreenCoinsXP)screenData; popupController.RewardPopupAnimator.SetTrigger("ChestDismiss"); CoinsText.text = string.Format(Service.Get <Localizer>().GetTokenTranslation("GlobalUI.Notification.Coins"), this.screenData.CoinCount); if (this.screenData.CoinCount == 0) { CoinsGO.SetActive(value: false); } if (this.screenData.XPCount == 0) { XPGO.SetActive(value: false); } else { CoroutineRunner.Start(loadMascotXPPrefab(this.screenData.mascotName), this, "RewardPopupScreenCoinsXP.loadMascotXPPrefab"); } CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>(); if (cPDataEntityCollection.TryGetComponent <MembershipData>(cPDataEntityCollection.LocalPlayerHandle, out var component)) { component.MembershipDataUpdated += onMembershipDataUpdated; } Service.Get <TrayNotificationManager>().DismissAllNotifications(); membershipNotificationText = Service.Get <Localizer>().GetTokenTranslation("MemberNotification.RewardScreen.LevelText"); checkMembershipDisclaimer(); }
public override void Init(DRewardPopupScreen screenData, RewardPopupController popupController) { this.screenData = (DRewardPopupScreenCount)screenData; RewardCategoryText.text = RewardUtils.GetUnlockText(this.screenData.CountCategory); RewardCountText.text = $"+ {this.screenData.Count}"; popupController.RewardChest.ChestAnimator.SetTrigger("LaunchItems"); isIntroComplete = false; tweenCountText(); }
private IEnumerator showPopupScreen(DRewardPopupScreen screenData) { PrefabContentKey screenContentKey = RewardPopupConstants.ScreenSplashContentKey; switch (screenData.ScreenType) { case DRewardPopupScreen.RewardScreenPopupType.splash: screenContentKey = RewardPopupConstants.ScreenSplashContentKey; break; case DRewardPopupScreen.RewardScreenPopupType.splash_levelup: screenContentKey = RewardPopupConstants.ScreenLevelUpContentKey; break; case DRewardPopupScreen.RewardScreenPopupType.splash_replay: screenContentKey = RewardPopupConstants.ScreenReplayContentKey; break; case DRewardPopupScreen.RewardScreenPopupType.items: screenContentKey = RewardPopupConstants.ScreenItemContentKey; break; case DRewardPopupScreen.RewardScreenPopupType.count: screenContentKey = RewardPopupConstants.ScreenCountContentKey; break; case DRewardPopupScreen.RewardScreenPopupType.coinsxp: screenContentKey = RewardPopupConstants.ScreenCoinsXPContentKey; break; case DRewardPopupScreen.RewardScreenPopupType.quests: screenContentKey = RewardPopupConstants.ScreenQuestsContentKey; break; case DRewardPopupScreen.RewardScreenPopupType.custom: { DRewardPopupScreenCustom dRewardPopupScreenCustom = screenData as DRewardPopupScreenCustom; if (dRewardPopupScreenCustom != null) { screenContentKey = dRewardPopupScreenCustom.ScreenKey; } break; } } AssetRequest <GameObject> assetRequest = Content.LoadAsync(screenContentKey); yield return(assetRequest); GameObject screenGO = UnityEngine.Object.Instantiate(assetRequest.Asset); screenGO.transform.SetParent(ScreenParentTransform, worldPositionStays: false); screenGO.GetComponent <RectTransform>().localPosition += new Vector3(0f, 0f, -100f); currentScreen = screenGO.GetComponent <RewardPopupScreen>(); currentScreen.ScreenCompleteAction += onCurrentScreenComplete; currentScreen.Init(screenData, this); }
public override void Init(DRewardPopupScreen screenData, RewardPopupController popupController) { this.screenData = (DRewardPopupScreenQuests)screenData; RewardCategoryText.text = Service.Get <Localizer>().GetTokenTranslation(TITLE_TEXT_KEY); isIntroComplete = false; loadItems(this.screenData.quests); UnlockedText.SetActive(Service.Get <CPDataEntityCollection>().IsLocalPlayerMember() && !this.screenData.IsRewardsAllNonMember); Service.Get <TrayNotificationManager>().DismissAllNotifications(); membershipNotificationText = Service.Get <Localizer>().GetTokenTranslation("MemberNotification.RewardScreen.QuestText"); checkMembershipDisclaimer(); }
private static int compareScreenByNonMemberScreen(DRewardPopupScreen screen1, DRewardPopupScreen screen2) { if (screen1.IsRewardsAllNonMember && !(screen1 is DRewardPopupScreenCoinsXP) && !screen2.IsRewardsAllNonMember) { return(-1); } if (screen2.IsRewardsAllNonMember && !(screen2 is DRewardPopupScreenCoinsXP) && !screen1.IsRewardsAllNonMember) { return(1); } return(screen1.PreferredSortOrder.CompareTo(screen2.PreferredSortOrder)); }
public override void Init(DRewardPopupScreen screenData, RewardPopupController popupController) { controller = popupController; this.screenData = (DRewardPopupScreenItems)screenData; RewardCategoryText.text = RewardUtils.GetUnlockText(this.screenData.ItemCategory); popupController.RewardChest.ChestAnimator.SetTrigger("LaunchItems"); isIntroComplete = false; loadItems(this.screenData.ItemCategory, this.screenData.Rewards); CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>(); if (cPDataEntityCollection.TryGetComponent <MembershipData>(cPDataEntityCollection.LocalPlayerHandle, out var component)) { component.MembershipDataUpdated += onMembershipDataUpdated; } checkMembershipDisclaimer(); showMemberStatusIndicator(); setBackground(); UnlockedText.SetActive(Service.Get <CPDataEntityCollection>().IsLocalPlayerMember() && !this.screenData.IsRewardsAllNonMember); }
public virtual void Init(DRewardPopupScreen screenData, RewardPopupController popupController) { }
public override void Init(DRewardPopupScreen screenData, RewardPopupController popupController) { this.popupController = popupController; Service.Get <EventDispatcher>().DispatchEvent(default(LevelUpPopupShown)); }
public override void Init(DRewardPopupScreen screenData, RewardPopupController popupController) { this.screenData = (DRewardPopupScreenSplash)screenData; this.popupController = popupController; Service.Get <EventDispatcher>().DispatchEvent(default(RewardPopupSplashShown)); }