diff options
author | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
commit | 6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch) | |
tree | 7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/XCutScene.cs |
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/XCutScene.cs')
-rw-r--r-- | Client/Assets/Scripts/XMainClient/XCutScene.cs | 701 |
1 files changed, 701 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/XCutScene.cs b/Client/Assets/Scripts/XMainClient/XCutScene.cs new file mode 100644 index 00000000..a3e1e9e4 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/XCutScene.cs @@ -0,0 +1,701 @@ +using System;
+using System.Collections.Generic;
+using UnityEngine;
+using XMainClient.UI;
+using XMainClient.UI.UICommon;
+using XUpdater;
+using XUtliPoolLib;
+
+namespace XMainClient
+{
+ internal class XCutScene : XSingleton<XCutScene>
+ {
+ public bool IsPlaying
+ {
+ get
+ {
+ return this._cut_scene;
+ }
+ }
+
+ public bool IsExcludeNewBorn
+ {
+ get
+ {
+ return this._exclusive;
+ }
+ set
+ {
+ this._exclusive = value;
+ }
+ }
+
+ public float Length
+ {
+ get
+ {
+ return this.IsPlaying ? this._cut_scene_data.Length : 0f;
+ }
+ }
+
+ public string Name
+ {
+ get
+ {
+ return this._name;
+ }
+ }
+
+ public Vector3 EndWithPos { get; set; }
+
+ public float EndWithDir { get; set; }
+
+ public uint GeneralMonsterID { get; set; }
+
+ public Dictionary<uint, XActor> _common_actors = new Dictionary<uint, XActor>();
+
+ private List<XFx> _common_fx = new List<XFx>();
+
+ private bool _cut_scene = false;
+
+ private bool _exclusive = true;
+
+ private List<uint> _eventToken = new List<uint>();
+
+ private List<XActor> _actors = null;
+
+ protected List<XFx> _fx = new List<XFx>();
+
+ private XCutSceneData _cut_scene_data = null;
+
+ private XCameraMotionData _camera = new XCameraMotionData();
+
+ private XEntity _target = null;
+
+ private uint _token = 0u;
+
+ private string _name = null;
+
+ private XTimerMgr.ElapsedEventHandler _startCb = null;
+
+ private XTimerMgr.ElapsedEventHandler _endCb = null;
+
+ private XTimerMgr.ElapsedEventHandler _actorOnStageCb = null;
+
+ private XTimerMgr.ElapsedEventHandler _playerOnStageCb = null;
+
+ private XTimerMgr.ElapsedEventHandler _fxCb = null;
+
+ private XTimerMgr.ElapsedEventHandler _audioCb = null;
+
+ private XTimerMgr.ElapsedEventHandler _subTitleCb = null;
+
+ private XTimerMgr.ElapsedEventHandler _slashCb = null;
+
+ private XTimerMgr.ElapsedEventHandler _endShowCb = null;
+
+ private XTimerMgr.ElapsedEventHandler _endSubTitleCb = null;
+
+ private CommandCallback _findFxTransCb = null;
+
+ private bool _bFadeAtEnd = true;
+
+ private float farClipPlaneBackUP = 150f;
+
+ public XCutScene()
+ {
+ this._camera.AutoSync_At_Begin = false;
+ this._camera.Coordinate = CameraMotionSpace.World;
+ this._camera.Follow_Position = false;
+ this._camera.LookAt_Target = false;
+ this._camera.At = 0f;
+ this._camera.MotionType = CameraMotionType.AnchorBased;
+ this._startCb = new XTimerMgr.ElapsedEventHandler(this.InnerStart);
+ this._endCb = new XTimerMgr.ElapsedEventHandler(this.InnerEnd);
+ this._actorOnStageCb = new XTimerMgr.ElapsedEventHandler(this.ActorOnStage);
+ this._playerOnStageCb = new XTimerMgr.ElapsedEventHandler(this.PlayerOnStage);
+ this._fxCb = new XTimerMgr.ElapsedEventHandler(this.Fx);
+ this._audioCb = new XTimerMgr.ElapsedEventHandler(this.Audio);
+ this._subTitleCb = new XTimerMgr.ElapsedEventHandler(this.SubTitle);
+ this._slashCb = new XTimerMgr.ElapsedEventHandler(this.Slash);
+ this._endShowCb = new XTimerMgr.ElapsedEventHandler(this.EndShow);
+ this._endSubTitleCb = new XTimerMgr.ElapsedEventHandler(this.EndSubTitle);
+ this._findFxTransCb = new CommandCallback(this.AttachFx);
+ }
+
+ public void Start(string cutname, bool bFadeOut = true, bool bFadeAtEnd = true)
+ {
+ bool cut_scene = this._cut_scene;
+ if (cut_scene)
+ {
+ XSingleton<XCutScene>.singleton.Stop(true);
+ }
+ this._bFadeAtEnd = bFadeAtEnd;
+ this._actors = new List<XActor>();
+ XSingleton<XAudioMgr>.singleton.StopSoundForCutscene();
+ XSingleton<XOperationRecord>.singleton.DoScriptRecord(cutname);
+ XSingleton<XPostEffectMgr>.singleton.MakeEffectEnable(XPostEffect.BlackWhite, false);
+ this._cut_scene = true;
+ this._name = cutname;
+ this._cut_scene_data = XSingleton<XResourceLoaderMgr>.singleton.GetData<XCutSceneData>(this._name, ".txt");
+ XBillBoardDocument.SetAllBillBoardState(BillBoardHideType.CutScene, false);
+ bool flag = XSingleton<XGame>.singleton.CurrentStage is XConcreteStage;
+ if (flag)
+ {
+ XSingleton<XGameUI>.singleton.ShowBlock(true);
+ }
+ bool overrideBGM = this._cut_scene_data.OverrideBGM;
+ if (overrideBGM)
+ {
+ XSingleton<XScene>.singleton.PauseBGM();
+ }
+ bool flag2 = DlgBase<BattleMain, BattleMainBehaviour>.singleton.IsLoaded();
+ if (flag2)
+ {
+ DlgBase<BattleMain, BattleMainBehaviour>.singleton.OnStopVoiceRecord();
+ }
+ bool flag3 = DlgBase<SpectateSceneView, SpectateSceneBehaviour>.singleton.IsLoaded();
+ if (flag3)
+ {
+ DlgBase<SpectateSceneView, SpectateSceneBehaviour>.singleton.OnStopVoiceRecord();
+ }
+ XSingleton<XShell>.singleton.TimeMagicBack();
+ XSingleton<XAIGeneralMgr>.singleton.EnablePlayerAI(false);
+ List<XEntity> ally = XSingleton<XEntityMgr>.singleton.GetAlly(XSingleton<XEntityMgr>.singleton.Player);
+ for (int i = 0; i < ally.Count; i++)
+ {
+ bool flag4 = ally[i] != XSingleton<XEntityMgr>.singleton.Player;
+ if (flag4)
+ {
+ XAIEnableAI @event = XEventPool<XAIEnableAI>.GetEvent();
+ @event.Firer = ally[i];
+ @event.Enable = false;
+ XSingleton<XEventMgr>.singleton.FireEvent(@event);
+ }
+ }
+ bool flag5 = string.IsNullOrEmpty(this._cut_scene_data.CameraClip);
+ if (flag5)
+ {
+ XAutoFade.FadeOut2In(1f, 2.5f);
+ this.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer(1f, this._endCb, null));
+ }
+ else if (bFadeOut)
+ {
+ XAutoFade.FadeOut2In(0.5f, 0.5f);
+ this.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer(0.5f, this._startCb, null));
+ }
+ else
+ {
+ this.InnerStart(this);
+ }
+ }
+
+ public void Stop(bool bImmdiately = false)
+ {
+ bool isPlaying = this.IsPlaying;
+ if (isPlaying)
+ {
+ for (int i = 0; i < this._eventToken.Count; i++)
+ {
+ XSingleton<XTimerMgr>.singleton.KillTimer(this._eventToken[i]);
+ }
+ this._eventToken.Clear();
+ if (bImmdiately)
+ {
+ this.InnerEnd(null);
+ }
+ else
+ {
+ this.EndShow(null);
+ }
+ }
+ }
+
+ public void ClearCommon()
+ {
+ for (int i = 0; i < this._common_fx.Count; i++)
+ {
+ bool flag = this._common_fx[i] != null;
+ if (flag)
+ {
+ XSingleton<XFxMgr>.singleton.DestroyFx(this._common_fx[i], true);
+ }
+ }
+ this._common_fx.Clear();
+ foreach (XActor xactor in this._common_actors.Values)
+ {
+ xactor.Uninitilize();
+ }
+ this._common_actors.Clear();
+ }
+
+ public void OnLeaveScene()
+ {
+ bool isPlaying = this.IsPlaying;
+ if (isPlaying)
+ {
+ this.Stop(true);
+ XAutoFade.FastFadeIn();
+ }
+ }
+
+ public void AddedTimerToken(uint token)
+ {
+ this._eventToken.Add(token);
+ }
+
+ private void InnerStart(object o)
+ {
+ XSingleton<XInput>.singleton.Freezed = true;
+ bool flag = o == null;
+ if (flag)
+ {
+ XAutoFade.MakeBlack(false);
+ }
+ this.farClipPlaneBackUP = XSingleton<XScene>.singleton.GameCamera.UnityCamera.farClipPlane;
+ XSingleton<XScene>.singleton.GameCamera.UnityCamera.farClipPlane = 150f;
+ XSingleton<XScene>.singleton.GameCamera.UnityCamera.fieldOfView = this._cut_scene_data.FieldOfView;
+ this._camera.Motion = this._cut_scene_data.CameraClip;
+ this._camera.Follow_Position = this._cut_scene_data.GeneralShow;
+ this._camera.AutoSync_At_Begin = this._cut_scene_data.GeneralShow;
+ bool flag2 = XSingleton<XScene>.singleton.GameCamera.CloseUp != null;
+ if (flag2)
+ {
+ XSingleton<XScene>.singleton.GameCamera.CloseUp.Stop(null);
+ }
+ bool flag3 = XSingleton<XScene>.singleton.GameCamera.Collision != null;
+ if (flag3)
+ {
+ XSingleton<XScene>.singleton.GameCamera.Collision.Enabled = false;
+ }
+ bool flag4 = XSingleton<XScene>.singleton.GameCamera.VAdjust != null;
+ if (flag4)
+ {
+ XSingleton<XScene>.singleton.GameCamera.VAdjust.Enabled = false;
+ }
+ bool flag5 = XSingleton<XScene>.singleton.GameCamera.Solo != null;
+ if (flag5)
+ {
+ XSingleton<XScene>.singleton.GameCamera.Solo.Stop();
+ }
+ foreach (XActorDataClip xactorDataClip in this._cut_scene_data.Actors)
+ {
+ this.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer(xactorDataClip.TimeLineAt / 30f - 0.016f, this._actorOnStageCb, xactorDataClip));
+ }
+ bool generalShow = this._cut_scene_data.GeneralShow;
+ if (generalShow)
+ {
+ bool flag6 = XSingleton<XEntityMgr>.singleton.Boss != null;
+ if (flag6)
+ {
+ this._target = XSingleton<XEntityMgr>.singleton.Boss;
+ }
+ else
+ {
+ bool flag7 = this.GeneralMonsterID > 0u;
+ if (flag7)
+ {
+ Vector3 zero = Vector3.zero;
+ float angle = 0f;
+ bool flag8 = XSingleton<XLevelSpawnMgr>.singleton.QueryMonsterStaticInfo(this.GeneralMonsterID, ref zero, ref angle);
+ if (flag8)
+ {
+ this._target = XSingleton<XEntityMgr>.singleton.CreateDummy(this.GeneralMonsterID, zero, XSingleton<XCommon>.singleton.FloatToQuaternion(angle));
+ }
+ else
+ {
+ XSingleton<XDebug>.singleton.AddErrorLog("QueryMonsterStaticInfo failed with id ", this.GeneralMonsterID.ToString(), " in cutscene ", this._cut_scene_data.Name, null, null);
+ }
+ }
+ else
+ {
+ XSingleton<XDebug>.singleton.AddErrorLog("Missing Boss id in general cutscene script with name ", this._cut_scene_data.Name, null, null, null, null);
+ }
+ }
+ }
+ XCameraMotionEventArgs @event = XEventPool<XCameraMotionEventArgs>.GetEvent();
+ @event.Motion = this._camera;
+ @event.Target = this._target;
+ @event.Trigger = this._cut_scene_data.Trigger;
+ @event.Firer = XSingleton<XScene>.singleton.GameCamera;
+ XSingleton<XEventMgr>.singleton.FireEvent(@event);
+ bool flag9 = !this._cut_scene_data.GeneralShow;
+ if (flag9)
+ {
+ foreach (XPlayerDataClip xplayerDataClip in this._cut_scene_data.Player)
+ {
+ this.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer(xplayerDataClip.TimeLineAt / 30f - 0.016f, this._playerOnStageCb, xplayerDataClip));
+ }
+ foreach (XFxDataClip xfxDataClip in this._cut_scene_data.Fxs)
+ {
+ this.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer(xfxDataClip.TimeLineAt / 30f, this._fxCb, xfxDataClip));
+ }
+ }
+ foreach (XAudioDataClip xaudioDataClip in this._cut_scene_data.Audios)
+ {
+ this.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer(xaudioDataClip.TimeLineAt / 30f, this._audioCb, xaudioDataClip));
+ }
+ bool mourningborder = this._cut_scene_data.Mourningborder;
+ if (mourningborder)
+ {
+ DlgBase<CutSceneUI, CutSceneUIBehaviour>.singleton.SetVisible(true, true);
+ foreach (XSubTitleDataClip xsubTitleDataClip in this._cut_scene_data.SubTitle)
+ {
+ this.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer(xsubTitleDataClip.TimeLineAt / 30f, this._subTitleCb, xsubTitleDataClip));
+ }
+ foreach (XSlashDataClip xslashDataClip in this._cut_scene_data.Slash)
+ {
+ this.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer(xslashDataClip.TimeLineAt / 30f, new XTimerMgr.ElapsedEventHandler(this.Slash), xslashDataClip));
+ }
+ }
+ else
+ {
+ bool flag10 = XSingleton<XGame>.singleton.CurrentStage.Stage == EXStage.World;
+ if (flag10)
+ {
+ }
+ }
+ bool autoEnd = this._cut_scene_data.AutoEnd;
+ if (autoEnd)
+ {
+ this.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer((this._cut_scene_data.TotalFrame - 30f) / 30f, this._endShowCb, null));
+ }
+ this.Reflection();
+ XSingleton<XEntityMgr>.singleton.Dummilize(this._cut_scene_data.TypeMask);
+ bool flag11 = this.EndWithPos.sqrMagnitude > 0.1f;
+ if (flag11)
+ {
+ this.CorrectToEndPos();
+ }
+ }
+
+ public void Reflection()
+ {
+ bool flag = this._cut_scene_data != null;
+ if (flag)
+ {
+ bool flag2 = !string.IsNullOrEmpty(this._cut_scene_data.Script);
+ if (flag2)
+ {
+ XSingleton<ScriptCode>.singleton.ExecuteCutScene(this._cut_scene_data.Script, this._actors);
+ }
+ }
+ }
+
+ private void ActorOnStage(object o)
+ {
+ XActorDataClip xactorDataClip = o as XActorDataClip;
+ XActor xactor = null;
+ bool flag = !string.IsNullOrEmpty(xactorDataClip.Tag);
+ if (flag)
+ {
+ int num = 0;
+ bool flag2 = int.TryParse(xactorDataClip.Tag, out num) && num > XGame.RoleCount;
+ if (flag2)
+ {
+ return;
+ }
+ }
+ Vector3 pos;
+ pos= new Vector3(xactorDataClip.AppearX, xactorDataClip.AppearY, xactorDataClip.AppearZ);
+ bool flag3 = xactorDataClip.bUsingID && xactorDataClip.bToCommonPool;
+ if (flag3)
+ {
+ bool flag4 = !this._common_actors.TryGetValue((uint)xactorDataClip.StatisticsID, out xactor);
+ if (flag4)
+ {
+ xactor = (xactorDataClip.bUsingID ? new XActor((uint)xactorDataClip.StatisticsID, pos, xactorDataClip.Clip) : new XActor(xactorDataClip.Prefab, pos, Quaternion.identity, xactorDataClip.Clip));
+ xactor.Initilize(0);
+ bool flag5 = !string.IsNullOrEmpty(xactorDataClip.Tag);
+ if (flag5)
+ {
+ xactor.EngineObject.Tag = xactorDataClip.Tag;
+ }
+ this._common_actors.Add((uint)xactorDataClip.StatisticsID, xactor);
+ }
+ else
+ {
+ xactor.PlayAnimation(xactorDataClip.Clip);
+ }
+ }
+ else
+ {
+ xactor = (xactorDataClip.bUsingID ? new XActor((uint)xactorDataClip.StatisticsID, pos, xactorDataClip.Clip) : new XActor(xactorDataClip.Prefab, pos, Quaternion.identity, xactorDataClip.Clip));
+ xactor.Initilize(0);
+ }
+ this._actors.Add(xactor);
+ this.Reflection();
+ }
+
+ private void PlayerOnStage(object o)
+ {
+ XPlayerDataClip xplayerDataClip = o as XPlayerDataClip;
+ Vector3 pos;
+ pos= new Vector3(xplayerDataClip.AppearX, xplayerDataClip.AppearY, xplayerDataClip.AppearZ);
+ XActor xactor;
+ switch (XSingleton<XEntityMgr>.singleton.Player.BasicTypeID)
+ {
+ case 1u:
+ xactor = new XActor(pos, xplayerDataClip.Clip1);
+ break;
+ case 2u:
+ xactor = new XActor(pos, xplayerDataClip.Clip2);
+ break;
+ case 3u:
+ xactor = new XActor(pos, xplayerDataClip.Clip3);
+ break;
+ case 4u:
+ xactor = new XActor(pos, xplayerDataClip.Clip4);
+ break;
+ case 5u:
+ xactor = new XActor(pos, xplayerDataClip.Clip5);
+ break;
+ case 6u:
+ xactor = new XActor(pos, xplayerDataClip.Clip6);
+ break;
+ case 7u:
+ xactor = new XActor(pos, xplayerDataClip.Clip7);
+ break;
+ default:
+ xactor = new XActor(pos, null);
+ break;
+ }
+ xactor.Initilize(0);
+ this._actors.Add(xactor);
+ this.Reflection();
+ }
+
+ private void AttachFx(XGameObject go, object o, int commandID)
+ {
+ XFxDataClip xfxDataClip = o as XFxDataClip;
+ XFx xfx = XSingleton<XFxMgr>.singleton.CreateFx(xfxDataClip.Fx, null, false);
+ xfx.DelayDestroy = xfxDataClip.Destroy_Delay;
+ Transform transform = (go != null) ? go.Find(xfxDataClip.Bone) : null;
+ bool flag = transform != null;
+ if (flag)
+ {
+ xfx.Play(transform, Vector3.zero, xfxDataClip.Scale * Vector3.one, 1f, xfxDataClip.Follow, false);
+ bool flag2 = this._common_actors.ContainsValue(this._actors[xfxDataClip.BindIdx]);
+ if (flag2)
+ {
+ this._common_fx.Add(xfx);
+ }
+ }
+ else
+ {
+ xfx.Play(new Vector3(xfxDataClip.AppearX, xfxDataClip.AppearY, xfxDataClip.AppearZ), XSingleton<XCommon>.singleton.FloatToQuaternion(xfxDataClip.Face), Vector3.one, 1f);
+ }
+ this._fx.Add(xfx);
+ }
+
+ private void Fx(object o)
+ {
+ XFxDataClip xfxDataClip = o as XFxDataClip;
+ bool flag = xfxDataClip.BindIdx >= 0;
+ if (flag)
+ {
+ XGameObject engineObject = this._actors[xfxDataClip.BindIdx].EngineObject;
+ engineObject.CallCommand(this._findFxTransCb, o, -1, false);
+ }
+ else
+ {
+ this.AttachFx(null, o, -1);
+ }
+ }
+
+ private void Audio(object o)
+ {
+ XAudioDataClip xaudioDataClip = o as XAudioDataClip;
+ bool flag = xaudioDataClip.BindIdx < 0;
+ if (flag)
+ {
+ XSingleton<XAudioMgr>.singleton.PlayUISound(xaudioDataClip.Clip, true, xaudioDataClip.Channel);
+ }
+ else
+ {
+ bool flag2 = XSingleton<XEntityMgr>.singleton.Player != null;
+ if (flag2)
+ {
+ XSingleton<XAudioMgr>.singleton.PlaySound(this._actors[xaudioDataClip.BindIdx], xaudioDataClip.Channel, xaudioDataClip.Clip, false, new XAudioExParam("PlayerClass", XSingleton<XEntityMgr>.singleton.Player.PlayerAttributes.BasicTypeID));
+ }
+ else
+ {
+ XSingleton<XAudioMgr>.singleton.PlaySound(this._actors[xaudioDataClip.BindIdx], xaudioDataClip.Channel, xaudioDataClip.Clip);
+ }
+ }
+ }
+
+ private void SubTitle(object o)
+ {
+ XSubTitleDataClip xsubTitleDataClip = o as XSubTitleDataClip;
+ DlgBase<CutSceneUI, CutSceneUIBehaviour>.singleton.SetText(xsubTitleDataClip.Context);
+ XSingleton<XTimerMgr>.singleton.KillTimer(this._token);
+ this._token = XSingleton<XTimerMgr>.singleton.SetTimer(xsubTitleDataClip.Duration / 30f, this._endSubTitleCb, null);
+ }
+
+ private void Slash(object o)
+ {
+ XSlashDataClip xslashDataClip = o as XSlashDataClip;
+ bool generalShow = this._cut_scene_data.GeneralShow;
+ if (generalShow)
+ {
+ string name = "";
+ bool flag = this._target != null && (this._target.IsDummy || XEntity.ValideEntity(this._target));
+ if (flag)
+ {
+ XEntityStatistics.RowData byID = XSingleton<XEntityMgr>.singleton.EntityStatistics.GetByID(this._target.TypeID);
+ bool flag2 = byID != null;
+ if (flag2)
+ {
+ name = byID.Name;
+ }
+ }
+ DlgBase<CutSceneUI, CutSceneUIBehaviour>.singleton.SetIntroText(true, name, xslashDataClip.Discription, xslashDataClip.AnchorX, xslashDataClip.AnchorY);
+ }
+ else
+ {
+ DlgBase<CutSceneUI, CutSceneUIBehaviour>.singleton.SetIntroText(true, xslashDataClip.Name, xslashDataClip.Discription, xslashDataClip.AnchorX, xslashDataClip.AnchorY);
+ }
+ this.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer(xslashDataClip.Duration, new XTimerMgr.ElapsedEventHandler(this.EndSlash), null));
+ }
+
+ private void EndShow(object o)
+ {
+ bool bFadeAtEnd = this._bFadeAtEnd;
+ if (bFadeAtEnd)
+ {
+ XAutoFade.FadeOut2In(1f, 1f);
+ }
+ this.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer(0.984f, this._endCb, null));
+ }
+
+ private void EndSlash(object o)
+ {
+ DlgBase<CutSceneUI, CutSceneUIBehaviour>.singleton.SetIntroText(false, "", "", 0f, 0f);
+ }
+
+ private void EndSubTitle(object o)
+ {
+ DlgBase<CutSceneUI, CutSceneUIBehaviour>.singleton.SetText("");
+ }
+
+ private void InnerEnd(object o)
+ {
+ bool overrideBGM = this._cut_scene_data.OverrideBGM;
+ if (overrideBGM)
+ {
+ XSingleton<XScene>.singleton.ResumeBGM();
+ }
+ XSingleton<XTimerMgr>.singleton.KillTimer(this._token);
+ for (int i = 0; i < this._eventToken.Count; i++)
+ {
+ XSingleton<XTimerMgr>.singleton.KillTimer(this._eventToken[i]);
+ }
+ this._eventToken.Clear();
+ XBillBoardDocument.SetAllBillBoardState(BillBoardHideType.CutScene, true);
+ for (int j = 0; j < this._fx.Count; j++)
+ {
+ bool flag = !this._common_fx.Contains(this._fx[j]);
+ if (flag)
+ {
+ XSingleton<XFxMgr>.singleton.DestroyFx(this._fx[j], true);
+ }
+ }
+ this._fx.Clear();
+ for (int k = 0; k < this._actors.Count; k++)
+ {
+ bool flag2 = !this._common_actors.ContainsValue(this._actors[k]);
+ if (flag2)
+ {
+ this._actors[k].Uninitilize();
+ }
+ }
+ this._actors.Clear();
+ this._actors = null;
+ XSingleton<XScene>.singleton.GameCamera.FovBack();
+ this._cut_scene = false;
+ this._name = null;
+ XSingleton<XEntityMgr>.singleton.Dedummilize();
+ this.Reflection();
+ bool mourningborder = this._cut_scene_data.Mourningborder;
+ if (mourningborder)
+ {
+ this.EndSubTitle(null);
+ DlgBase<CutSceneUI, CutSceneUIBehaviour>.singleton.SetVisible(false, true);
+ XSingleton<XPostEffectMgr>.singleton.MakeEffectEnable(XPostEffect.BlackWhite, XSingleton<XEntityMgr>.singleton.Player.IsDead);
+ }
+ bool flag3 = !string.IsNullOrEmpty(this._cut_scene_data.CameraClip);
+ if (flag3)
+ {
+ XCameraMotionEndEventArgs @event = XEventPool<XCameraMotionEndEventArgs>.GetEvent();
+ @event.Target = this._target;
+ @event.Firer = XSingleton<XScene>.singleton.GameCamera;
+ @event.CutSceneEnd = true;
+ XSingleton<XEventMgr>.singleton.FireEvent(@event);
+ }
+ bool flag4 = this._target != null && this._target.IsDummy;
+ if (flag4)
+ {
+ XSingleton<XEntityMgr>.singleton.DestroyImmediate(this._target);
+ }
+ this._target = null;
+ XSingleton<XInput>.singleton.Freezed = false;
+ bool flag5 = XSingleton<XGame>.singleton.CurrentStage is XConcreteStage;
+ if (flag5)
+ {
+ XSingleton<XGameUI>.singleton.ShowBlock(false);
+ }
+ bool flag6 = XSingleton<XEntityMgr>.singleton.Player != null && !XSingleton<XLevelFinishMgr>.singleton.IsCurrentLevelFinished;
+ if (flag6)
+ {
+ XSingleton<XAIGeneralMgr>.singleton.EnablePlayerAI(true);
+ List<XEntity> ally = XSingleton<XEntityMgr>.singleton.GetAlly(XSingleton<XEntityMgr>.singleton.Player);
+ for (int l = 0; l < ally.Count; l++)
+ {
+ bool flag7 = ally[l] != XSingleton<XEntityMgr>.singleton.Player;
+ if (flag7)
+ {
+ XAIEnableAI event2 = XEventPool<XAIEnableAI>.GetEvent();
+ event2.Firer = ally[l];
+ event2.Enable = true;
+ XSingleton<XEventMgr>.singleton.FireEvent(event2);
+ }
+ }
+ }
+ XSingleton<XScene>.singleton.GameCamera.TrySolo();
+ this.EndWithPos = Vector3.zero;
+ this.GeneralMonsterID = 0u;
+ XSingleton<XScene>.singleton.GameCamera.UnityCamera.farClipPlane = this.farClipPlaneBackUP;
+ bool flag8 = !XSingleton<XGame>.singleton.SyncMode && !XOperationData.Is3DMode() && XEntity.ValideEntity(XSingleton<XEntityMgr>.singleton.Player);
+ if (flag8)
+ {
+ XSingleton<XScene>.singleton.GameCamera.Root_R_Y = XSingleton<XCommon>.singleton.AngleToFloat(XSingleton<XEntityMgr>.singleton.Player.MoveObj.Forward);
+ }
+ bool flag9 = DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.IsVisible();
+ if (flag9)
+ {
+ DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.RefreshWelcomeBackFlow();
+ }
+ }
+
+ private void CorrectToEndPos()
+ {
+ bool syncMode = XSingleton<XGame>.singleton.SyncMode;
+ if (!syncMode)
+ {
+ List<XEntity> ally = XSingleton<XEntityMgr>.singleton.GetAlly(XSingleton<XEntityMgr>.singleton.Player);
+ for (int i = 0; i < ally.Count; i++)
+ {
+ bool flag = ally[i].IsRole || (ally[i].MobbedBy != null && ally[i].MobbedBy.IsRole && ally[i].Attributes != null && ally[i].Attributes.RunSpeed > 0f);
+ if (flag)
+ {
+ XOnEntityTransferEventArgs @event = XEventPool<XOnEntityTransferEventArgs>.GetEvent();
+ @event.Firer = ally[i];
+ XSingleton<XEventMgr>.singleton.FireEvent(@event);
+ ally[i].CorrectMe(this.EndWithPos, XSingleton<XCommon>.singleton.FloatToAngle(this.EndWithDir), false, false);
+ }
+ }
+ }
+ }
+ }
+}
|