StoryE22P1.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. using System;
  2. using System.Collections;
  3. using Core;
  4. using GameWorld;
  5. using I2.Loc;
  6. using UnityEngine;
  7. public class StoryE22P1 : BaseBehaviour
  8. {
  9. private bool E22Email
  10. {
  11. set
  12. {
  13. RoundStorage.Set("E22_Email", value);
  14. }
  15. }
  16. private void OnEnable()
  17. {
  18. EventManager.RegisterEvent<BattleEventArgs>("Battle", new EventManager.FBEventHandler<BattleEventArgs>(this.BattleOver), EventManager.ListenerQueue.Game);
  19. }
  20. private void OnDisable()
  21. {
  22. EventManager.UnregisterEvent<BattleEventArgs>("Battle", new EventManager.FBEventHandler<BattleEventArgs>(this.BattleOver), EventManager.ListenerQueue.Game);
  23. }
  24. private void Start()
  25. {
  26. if (R.Player.Attribute.flashLevel >= 2)
  27. {
  28. UnityEngine.Object.Destroy(this.supplyBox.gameObject);
  29. UnityEngine.Object.Destroy(base.gameObject);
  30. }
  31. }
  32. private bool BattleOver(string eventName, object sender, BattleEventArgs args)
  33. {
  34. if (args.Status == BattleEventArgs.BattleStatus.End)
  35. {
  36. base.StartCoroutine(this.P1Coroutine());
  37. }
  38. return true;
  39. }
  40. private IEnumerator P1Coroutine()
  41. {
  42. this.gate.openType = SceneGate.OpenType.None;
  43. this._battleZoneGateL.Appear();
  44. yield return R.Audio.PlayVoiceOver("e22t1", null, false);
  45. yield return this.supplyBox.WaitForBreak();
  46. yield return new WaitForSeconds(2f);
  47. if (!InputSetting.IsWorking())
  48. {
  49. InputSetting.Resume(false);
  50. }
  51. R.Player.Attribute.flashLevel = 2;
  52. R.Player.Attribute.currentFlashTimes = R.Player.Attribute.flashTimes;
  53. R.Player.Attribute.FlashCd = 0;
  54. R.Ui.Flash.RecoverAll(R.Player.Attribute.flashTimes);
  55. yield return R.Audio.PlayVoiceOver("e22t2", null, false);
  56. R.Mode.EnterMode(Mode.AllMode.Story);
  57. yield return R.Ui.Tutorial.PlayVideo("Movies/ps4", "flash2.mp4");
  58. R.Mode.ExitMode(Mode.AllMode.Story);
  59. yield return new WaitForSeconds(3f);
  60. yield return R.Audio.PlayVoiceOver("e22t3", null, false);
  61. SingletonMono<WorldTime>.Instance.TimeFrozenByFixedFrame(1, WorldTime.FrozenArgs.FrozenType.Player, false);
  62. WorldTime.Pause();
  63. R.Mode.EnterMode(Mode.AllMode.UI);
  64. R.Ui.Pause.Enabled = false;
  65. R.Audio.IsEffectsMute = true;
  66. R.Audio.StopBGM(false);
  67. CameraFilterUtils.Create<CameraFilterPack_TV_Artefact>(null);
  68. yield return WorldTime.WaitForSecondsIgnoreTimeScale(3f);
  69. R.Audio.IsEffectsMute = false;
  70. this.E22Email = true;
  71. yield return R.Ui.uiNotifacation.Show(ScriptLocalization.Story.e22s1, 2f);
  72. R.Ui.uiNotifacation.FadeIn(ScriptLocalization.mobile.e22s2);
  73. while (!Core.Input.AnyKey.OnClick)
  74. {
  75. yield return null;
  76. }
  77. R.Audio.PlayEffect(364, null);
  78. yield return R.Ui.uiNotifacation.FadeOut(0f, 1f);
  79. yield return R.Ui.Terminal.OpenWithAnim(new Color?(Color.white));
  80. WorldTime.Resume();
  81. yield return R.Ui.Terminal.Print(ScriptLocalization.Story.e22s3, 0.1f);
  82. yield return R.Ui.Terminal.Println(ScriptLocalization.Story.e22s4, 0.5f);
  83. yield return R.Ui.Terminal.Println(string.Format(ScriptLocalization.mobile.e22s5, DateTime.Now), 0.1f);
  84. yield return R.Ui.Terminal.ShowTexture((!UILanguage.IsChinese) ? this._map : this._mapCn, 0.3f, 1f);
  85. bool hasShowRawImage = false;
  86. for (;;)
  87. {
  88. if (Core.Input.AnyKey.OnClick)
  89. {
  90. if (hasShowRawImage)
  91. {
  92. break;
  93. }
  94. R.Ui.Terminal.SetTextureFullScreen();
  95. hasShowRawImage = true;
  96. yield return new WaitForSeconds(1f);
  97. }
  98. yield return null;
  99. }
  100. R.Ui.Terminal.SetTextureSize(0.3f);
  101. yield return new WaitForSeconds(0.3f);
  102. yield return R.Ui.Terminal.CloseWithAnim();
  103. R.Ui.Terminal.HideTexture();
  104. SingletonMono<WorldTime>.Instance.FrozenResume();
  105. CameraFilterUtils.Remove<CameraFilterPack_TV_Artefact>(null);
  106. this.gate.openType = SceneGate.OpenType.Right;
  107. this._battleZoneGateL.DisAppear();
  108. R.Mode.ExitMode(Mode.AllMode.UI);
  109. yield break;
  110. }
  111. [SerializeField]
  112. private BattleZoneGate _battleZoneGateL;
  113. [SerializeField]
  114. private Texture _map;
  115. [SerializeField]
  116. private Texture _mapCn;
  117. [SerializeField]
  118. private SceneGate gate;
  119. [SerializeField]
  120. private SupplyBoxAction supplyBox;
  121. }