using System.Collections; using UnityEngine; using Wizard; using Wizard.UI.Dialog; public class RankMatchResultAnimationAgent : ResultAnimationAgent { public override IEnumerator RunUI(BattleResultUIController battleResultControl, INextSceneSelector nextSceneSelector, bool isWin) { m_BattleCamera.m_CutInCamera.gameObject.SetActive(value: false); if (battleResultControl.ResultReporter.LotteryData.IsEnable) { yield return LoadLotteryImage(battleResultControl.ResultReporter.LotteryData); } if (battleResultControl.IsDraw) { battleResultControl.TitleWin.gameObject.SetActive(value: false); battleResultControl.TitleLose.gameObject.SetActive(value: false); battleResultControl.TitleDraw.gameObject.SetActive(value: true); battleResultControl.TitleDraw.transform.localScale = Vector3.one * 10f; battleResultControl.TitleDraw.alpha = 0f; battleResultControl.Bg.color = new Color32(0, 48, 16, 0); battleResultControl.ResultTitle.spriteName = "result_top_lose"; } else if (isWin) { battleResultControl.TitleWin.transform.localScale = Vector3.one * 10f; battleResultControl.TitleWin.gameObject.SetActive(value: true); battleResultControl.TitleLose.gameObject.SetActive(value: false); battleResultControl.TitleDraw.gameObject.SetActive(value: false); battleResultControl.TitleWin.alpha = 0f; battleResultControl.Bg.color = new Color32(32, 24, 0, 0); battleResultControl.ResultTitle.spriteName = "result_top_win"; } else { battleResultControl.TitleLose.transform.localScale = Vector3.one * 10f; battleResultControl.TitleWin.gameObject.SetActive(value: false); battleResultControl.TitleLose.gameObject.SetActive(value: true); battleResultControl.TitleDraw.gameObject.SetActive(value: false); battleResultControl.TitleLose.alpha = 0f; battleResultControl.Bg.color = new Color32(0, 24, 48, 0); battleResultControl.ResultTitle.spriteName = "result_top_lose"; } battleResultControl.MainPanel.alpha = 1f; yield return new WaitForSeconds(0.1f); RankMatchBattleResult rankMatchBattleResult = battleResultControl.RankMatchBattleResultObject; RankInfo matchInfo = Data.Load.data.GetRankInfo(Data.CurrentFormat, rankMatchBattleResult.BeforeRankLv); if (!rankMatchBattleResult.IsPromoPrev) { battleResultControl.SetBackGroundNeedBattlePoint(needBattlePoint: true); } else { bool backGroundNeedBattlePoint = PlayerStaticData.UserPromotionWinCount >= matchInfo.necessary_win || PlayerStaticData.UserPromotionLoseCount >= matchInfo.reset_lose; battleResultControl.SetBackGroundNeedBattlePoint(backGroundNeedBattlePoint); } if (battleResultControl.IsDraw) { TweenAlpha.Begin(battleResultControl.TitleDraw.gameObject, 0.2f, 1f); iTween.ScaleTo(battleResultControl.TitleDraw.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOULOSE); GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_LOSE); } else if (isWin) { TweenAlpha.Begin(battleResultControl.TitleWin.gameObject, 0.2f, 1f); iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOUWIN); GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_WIN); } else { TweenAlpha.Begin(battleResultControl.TitleLose.gameObject, 0.2f, 1f); iTween.ScaleTo(battleResultControl.TitleLose.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_YOULOSE); GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_JINGLE_LOSE); } TweenAlpha.Begin(battleResultControl.Bg.gameObject, 0.5f, 0.75f); yield return new WaitForSeconds(0.2f); TweenAlpha.Begin(battleResultControl.ArcaneIn.gameObject, 0.5f, 1f); TweenAlpha.Begin(battleResultControl.ArcaneOut.gameObject, 0.5f, 1f); iTween.ScaleTo(battleResultControl.ArcaneIn.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); iTween.ScaleTo(battleResultControl.ArcaneOut.gameObject, iTween.Hash("scale", Vector3.one, "time", 2f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); if (battleResultControl.IsDraw) { GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_3, Vector3.zero); battleResultControl.TitleDraw.transform.localScale = Vector3.one; iTween.ScaleTo(battleResultControl.TitleDraw.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); } else if (isWin) { GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_1, Vector3.zero); battleResultControl.TitleWin.transform.localScale = Vector3.one; iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); } else { GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_TITLE_2, Vector3.zero); battleResultControl.TitleLose.transform.localScale = Vector3.one; iTween.ScaleTo(battleResultControl.TitleLose.gameObject, iTween.Hash("scale", Vector3.one * 1.1f, "time", 2f, "islocal", true, "easetype", iTween.EaseType.linear)); } HideEmotionMessage(); if (battleResultControl.ResultMsgWindowFlag) { StartCoroutine(battleResultControl.ShowSpecialResultInfo()); } yield return new WaitForSeconds(2f); if (battleResultControl.ResultReporter.LotteryData.IsEnable) { yield return CreateLotteryDialog(battleResultControl.ResultReporter.LotteryData); } RankWinnerReward winnerReward = GameMgr.GetIns()._rankWinnerReward; if (winnerReward == null) { int value = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_GRADE); string value2 = PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.BATTLE_WINNER_REWARD_STRING); if (value != 0 && value2 != "") { winnerReward = UIManager.GetInstance().createRankWinnerReward(); GameMgr.GetIns()._rankWinnerReward = winnerReward; winnerReward.SetInfomation(value, value2); winnerReward.gameObject.SetActive(value: false); } } if (winnerReward != null && isWin) { float seconds = 3f; StartCoroutine(winnerReward.ResultWinnerReward()); yield return new WaitForSeconds(seconds); StartCoroutine(winnerReward.HideRewardObject()); } if (!battleResultControl.IsDraw && ShowRewardDialog(battleResultControl)) { while (battleResultControl.IsRewardWait) { yield return null; } } if (Data.RankMatchFinish.data != null) { TreasureBoxCpResultInfo treasureBoxCpResultInfo = Data.RankMatchFinish.data.TreasureBoxCpResultInfo; if (treasureBoxCpResultInfo.IsPlayGradeUpAnimation()) { yield return TreasureBoxCpOpenBoxAnimation(battleResultControl, treasureBoxCpResultInfo.AfterGrade); } if (treasureBoxCpResultInfo.IsBoxOpened()) { yield return CreateTreasureBoxCpRewardDialog(treasureBoxCpResultInfo); } } if (battleResultControl.IsDraw) { TweenAlpha.Begin(battleResultControl.TitleDraw.gameObject, 0.2f, 0f); GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_3, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); } else if (isWin) { TweenAlpha.Begin(battleResultControl.TitleWin.gameObject, 0.2f, 0f); iTween.ScaleTo(battleResultControl.TitleWin.gameObject, iTween.Hash("scale", Vector3.one * 3f, "time", 0.2f, "islocal", true, "easetype", iTween.EaseType.easeInQuad)); GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_1, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); } else { TweenAlpha.Begin(battleResultControl.TitleLose.gameObject, 0.2f, 0f); GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_BACK_2, battleResultControl.AnchorBottom.transform.position, battleResultControl.AnchorBottom.gameObject); } if (winnerReward != null) { winnerReward.RemoveObject(); GameMgr.GetIns()._rankWinnerReward = null; } yield return new WaitForSeconds(0.2f); if (isWin) { GameMgr.GetIns().GetSoundMgr().PlayBGM(Bgm.BGM_TYPE.SYS_WIN_LOOP); } else { GameMgr.GetIns().GetSoundMgr().PlayBGM(Bgm.BGM_TYPE.SYS_LOSE_LOOP); } GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_WINDOW_APPER); iTween.MoveTo(battleResultControl.ClassCharObj.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ClassCharObj"], "time", 0.5f, "delay", 0.1f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); iTween.MoveTo(battleResultControl.ResultTitle.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ResultTitle"], "time", 0.5f, "delay", 0f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); iTween.MoveTo(battleResultControl.ClassInfo.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["ClassInfo"], "time", 0.5f, "delay", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); if (!rankMatchBattleResult.IsPromoPrev) { iTween.MoveTo(rankMatchBattleResult.RankInfo.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["RankInfo"], "time", 0.5f, "delay", 0.4f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); } yield return new WaitForSeconds(1f); if (rankMatchBattleResult.WinCount > 1) { TweenAlpha.Begin(rankMatchBattleResult.WinsObj.labels[0].gameObject, 0.3f, 1f); TweenAlpha.Begin(rankMatchBattleResult.WinsObj.labels[1].gameObject, 0.3f, 1f); iTween.MoveFrom(rankMatchBattleResult.WinsObj.gameObject, iTween.Hash("x", rankMatchBattleResult.WinsObj.transform.localPosition.x + 50f, "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); } if (isWin) { PlayWinVoice(); } if (battleResultControl.AddClassExp > 0) { battleResultControl.SettingAddClassExpTextAnimation(); yield return new WaitForSeconds(0.5f); for (int i = 0; i < 10; i++) { GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_GAUGEUP); yield return new WaitForSeconds(0.05f); } yield return new WaitForSeconds(0.5f); } if (rankMatchBattleResult.IsPromoPrev) { StartCoroutine(rankMatchBattleResult.RunMatchUI()); yield return new WaitForSeconds(3.5f); bool isEndPromo = false; if (PlayerStaticData.UserPromotionWinCount >= matchInfo.necessary_win) { isEndPromo = true; StartCoroutine(rankMatchBattleResult.RunTierUp()); battleResultControl.RankMatchBattleResultObject.IsRunUIStop = true; while (battleResultControl.RankMatchBattleResultObject.IsRunUIStop) { yield return null; } yield return new WaitForSeconds(0.5f); } else if (PlayerStaticData.UserPromotionLoseCount >= matchInfo.reset_lose) { isEndPromo = true; StartCoroutine(rankMatchBattleResult.RunFailed()); yield return new WaitForSeconds(3f); } if (isEndPromo) { PlayerStaticData.UserPromotionMatchCount = 0; iTween.MoveTo(rankMatchBattleResult.RankInfo.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["RankInfo"], "time", 0.5f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); yield return new WaitForSeconds(0.5f); } } if (!rankMatchBattleResult.IsPromoPrev || !rankMatchBattleResult.IsPromoNow) { if (rankMatchBattleResult.BasicExp_and_SuperiorBonus != 0) { rankMatchBattleResult.SettingAddRankExpTextAnimation(); yield return new WaitForSeconds(0.5f); for (int i = 0; i < 10; i++) { GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_GAUGEUP); yield return new WaitForSeconds(0.05f); } yield return new WaitForSeconds(0.5f); } if (rankMatchBattleResult.RankExpBonus > 0) { rankMatchBattleResult.AddRankExpBonus(); yield return new WaitForSeconds(0.5f); for (int i = 0; i < 10; i++) { GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_GAUGEUP); yield return new WaitForSeconds(0.05f); } yield return new WaitForSeconds(0.5f); } } if (!rankMatchBattleResult.IsPromoPrev && !rankMatchBattleResult.IsPromoNow) { if (PlayerStaticData.UserRankCurrentFormat() > rankMatchBattleResult.BeforeRankLv) { StartCoroutine(rankMatchBattleResult.RunRankUp()); battleResultControl.RankMatchBattleResultObject.IsRunUIStop = true; while (battleResultControl.RankMatchBattleResultObject.IsRunUIStop) { yield return null; } yield return new WaitForSeconds(0.5f); } else if (PlayerStaticData.UserRankCurrentFormat() < rankMatchBattleResult.BeforeRankLv) { StartCoroutine(rankMatchBattleResult.RunRankDown()); battleResultControl.RankMatchBattleResultObject.IsRunUIStop = true; while (battleResultControl.RankMatchBattleResultObject.IsRunUIStop) { yield return null; } yield return new WaitForSeconds(0.5f); } } if (!rankMatchBattleResult.IsPromoPrev && rankMatchBattleResult.IsPromoNow) { StartCoroutine(battleResultControl.RunMatch()); yield return new WaitForSeconds(3f); } if (Data.RankMatchFinish.data != null && Data.RankMatchFinish.data.SpeedChallengeAnnounceTime.HasValue) { SystemText systemText = Data.SystemText; DialogBase dialog = UIManager.GetInstance().CreateDialogClose(); dialog.SetButtonLayout(DialogBase.ButtonLayout.OkBtn); dialog.SetTitleLabel(systemText.Get("SpeedChallenge_0001")); dialog.SetSize(DialogBase.Size.M); GameObject gameObject = Object.Instantiate(Resources.Load("UI/layoutParts/Dialog/DialogSpeedChallenge")) as GameObject; dialog.SetObj(gameObject); DialogSpeedChallenge component = gameObject.GetComponent(); string text = string.Format(arg0: ConvertTime.ToLocal(Data.RankMatchFinish.data.SpeedChallengeAnnounceTime.Value, ConvertTime.FORMAT.TIME_DATE_LONG_SPECIAL), format: systemText.Get("SpeedChallenge_0002")); component.SetText(text); component.SetTexture("banner_000764"); while (dialog.IsOpen()) { yield return null; } } bool battlePathUIFinish = false; battleResultControl.SetBattlePassGauge(delegate { battlePathUIFinish = true; }); while (!battlePathUIFinish) { yield return null; } if (Data.RedEtherCampaignResultData != null) { bool isFinishRedEther = false; RedEtherCampaignPanel.Create(battleResultControl.gameObject, Data.RedEtherCampaignResultData, battleResultControl, delegate { isFinishRedEther = true; }); while (!isFinishRedEther) { yield return null; } yield return ShowRewardDialog(Data.RedEtherCampaignResultData.RewardList); } if (battleResultControl.ResultReporter.HomeDialogData != null && battleResultControl.ResultReporter.HomeDialogData.IsEnable) { bool homeDialogFinish = false; MyPageHomeDialog.Create(UIManager.GetInstance().HomeDialogPrefab, battleResultControl.resultReporter.HomeDialogData, delegate { homeDialogFinish = true; }); while (!homeDialogFinish) { yield return null; } } battleResultControl.GreySpriteBGVisible = false; nextSceneSelector.Show(); battleResultControl.PrepareAchievementLog(); battleResultControl.FinishResult(); } }