using System.Collections; using UnityEngine; namespace Wizard; public class CompetitionResultAnimationAgent : ResultAnimationAgent { private const float OBJECT_APPEAR_MOVE_SEC = 0.5f; private const float RESULT_TITLE_DELAY_SEC = 0f; private const float CLASS_CHAR_DELAY_SEC = 0.1f; private const float CLASS_INFO_DELAY_SEC = 0.3f; private const float GAUGE_WAIT_SEC = 0.5f; public override IEnumerator RunUI(BattleResultUIController battleResultControl, INextSceneSelector nextSceneSelector, bool isWin) { 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.gameObject.SetActive(value: true); battleResultControl.TitleLose.gameObject.SetActive(value: false); battleResultControl.TitleDraw.gameObject.SetActive(value: false); battleResultControl.TitleWin.transform.localScale = Vector3.one * 10f; battleResultControl.TitleWin.alpha = 0f; battleResultControl.Bg.color = new Color32(32, 24, 0, 0); battleResultControl.ResultTitle.spriteName = "result_top_win"; } else { battleResultControl.TitleWin.gameObject.SetActive(value: false); battleResultControl.TitleLose.gameObject.SetActive(value: true); battleResultControl.TitleDraw.gameObject.SetActive(value: false); battleResultControl.TitleLose.transform.localScale = Vector3.one * 10f; 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); 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.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)); yield return new WaitForSeconds(1f); if (isWin) { PlayWinVoice(); } if (battleResultControl.AddClassExp > 0) { battleResultControl.SettingAddClassExpTextAnimation(); yield return new WaitForSeconds(0.5f); yield return PlayGaugeUpSe(); yield return new WaitForSeconds(0.5f); } if (Data.CompetitionBattleFinish.DetailData.IsChampion) { yield return PlayCompetitionChampionAnimationCoroutine(battleResultControl); } battleResultControl.SetBattlePassGauge(delegate { nextSceneSelector.Show(); battleResultControl.PrepareAchievementLog(); battleResultControl.FinishResult(); battleResultControl.GreySpriteBGVisible = false; }); } private IEnumerator PlayGaugeUpSe() { SoundMgr soundMgr = GameMgr.GetIns().GetSoundMgr(); int i = 0; while (i < 10) { soundMgr.PlaySe(Se.TYPE.SYS_RESULT_GAUGEUP); yield return new WaitForSeconds(0.05f); int num = i + 1; i = num; } } private IEnumerator PlayCompetitionChampionAnimationCoroutine(BattleResultUIController controller) { controller.TitleMatch.spriteName = "colosseum_battle_title_03"; StartCoroutine(controller.RunMatch()); yield return new WaitForSeconds(3f); } }