using System.Collections; using UnityEngine; using Wizard; public class QuestSpecialResultAnimationAgent : ResultAnimationAgent { private bool IsBossRushTotalResult(bool isWin) { if (GameMgr.GetIns().GetDataMgr().m_BattleType == DataMgr.BattleType.BossRushQuest) { BossRushBattleData bossRushBattleData = GameMgr.GetIns().GetDataMgr().BossRushBattleData; bool flag = isWin && bossRushBattleData.CurrentWinCount + 1 >= bossRushBattleData.MaxBattleCount; return !isWin || flag; } return false; } public override IEnumerator RunUI(BattleResultUIController battleResultControl, INextSceneSelector nextSceneSelector, bool isWin) { if (battleResultControl.ResultReporter.LotteryData.IsEnable) { yield return LoadLotteryImage(battleResultControl.ResultReporter.LotteryData); } m_BattleCamera.m_CutInCamera.gameObject.SetActive(value: false); 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); battleResultControl.SetBackGroundNeedBattlePoint(needBattlePoint: true); 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); } if (BattleManagerBase.GetIns().IsPuzzleMgr && !isWin) { battleResultControl.SetBattlePassGauge(delegate { battleResultControl.FinishResult(); GameMgr.GetIns().GetBattleCtrl().BattleEnd(UIManager.ViewScene.QuestSelectionPage); }); yield break; } 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 (ShowRewardDialog(battleResultControl)) { while (battleResultControl.IsRewardWait) { yield return null; } } 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); } } 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)); iTween.MoveTo(battleResultControl.QuestBattleResultObject._questPointInfo.gameObject, iTween.Hash("position", battleResultControl.DefaultPosDict["QuestPointInfo"], "time", 0.5f, "delay", 0.3f, "islocal", true, "easetype", iTween.EaseType.easeOutExpo)); yield return new WaitForSeconds(1f); if (isWin) { PlayWinVoice(); } if (battleResultControl.AddClassExp > 0) { battleResultControl.SettingAddClassExpTextAnimation(); yield return new WaitForSeconds(0.5f); for (int i = 0; i < 10; i++) { yield return PlayUpdateGaugeSe(); } yield return new WaitForSeconds(0.5f); } if (Data.QuestFinish.data.AddPoint != 0) { battleResultControl.QuestBattleResultObject.SettingAddQuestPointTextAnimation(); yield return new WaitForSeconds(0.5f); for (int i = 0; i < 10; i++) { yield return PlayUpdateGaugeSe(); } yield return new WaitForSeconds(0.5f); } if (Data.QuestFinish.data.WinBonusPoint > 0) { battleResultControl.QuestBattleResultObject.AddWinBonusQuestPoint(); yield return new WaitForSeconds(0.5f); for (int i = 0; i < 10; i++) { yield return PlayUpdateGaugeSe(); } yield return new WaitForSeconds(0.5f); } if (Data.QuestFinish.data.GetTotalBonusPoint() > 0) { battleResultControl.QuestBattleResultObject.SettingAddBounusQuestPointTextAnimation(); yield return new WaitForSeconds(0.5f); for (int i = 0; i < 10; i++) { yield return PlayUpdateGaugeSe(); } yield return new WaitForSeconds(0.5f); } if (Data.QuestFinish.data.CommonMissionClearInfoList.Count > 0) { battleResultControl.QuestBattleResultObject.SettingAddCommonMissionQuestPointTextAnimation(); yield return new WaitForSeconds(0.5f); for (int i = 0; i < 10; i++) { yield return PlayUpdateGaugeSe(); } yield return new WaitForSeconds(0.5f); } if (Data.QuestFinish.data.CharacterMissionClearInfoList.Count > 0) { battleResultControl.QuestBattleResultObject.SettingAddCharacterMissionQuestPointTextAnimation(); yield return new WaitForSeconds(0.5f); for (int i = 0; i < 10; i++) { yield return PlayUpdateGaugeSe(); } yield return new WaitForSeconds(0.5f); } if (IsBossRushTotalResult(isWin)) { StartCoroutine(battleResultControl.QuestBattleResultObject.SettingBossRushFinishResultAnimation(isWin)); } yield return battleResultControl.QuestBattleResultObject.PlayAnimationCoroutine(); yield return PlayBattlePassGaugeCoroutine(battleResultControl); yield return OpenHomeDialogCoroutine(Data.QuestFinish.data.HomeDialogData); if (IsBossRushTotalResult(isWin)) { while (!battleResultControl.QuestBattleResultObject.IsBossRushTotalResultFinish) { yield return null; } } nextSceneSelector.Show(); battleResultControl.PrepareAchievementLog(); battleResultControl.FinishResult(); GameMgr.GetIns().GetDataMgr().SetPlayerEmotionId(string.Empty); GameMgr.GetIns().GetDataMgr().SetEnemyEmotionId(string.Empty); } private IEnumerator PlayUpdateGaugeSe() { GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_GAUGEUP); yield return new WaitForSeconds(0.05f); } private IEnumerator PlayBattlePassGaugeCoroutine(BattleResultUIController controller) { bool isFinished = false; controller.SetBattlePassGauge(delegate { isFinished = true; }); while (!isFinished) { yield return null; } } private IEnumerator OpenHomeDialogCoroutine(MyPageHomeDialogData dialogData) { if (dialogData != null && dialogData.IsEnable) { bool isClosed = false; MyPageHomeDialog.Create(UIManager.GetInstance().HomeDialogPrefab, dialogData, delegate { isClosed = true; }); while (!isClosed) { yield return null; } } } }