StoryE16P6.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. using System;
  2. using System.Collections;
  3. using DG.Tweening;
  4. using ExtensionMethods;
  5. using I2.Loc;
  6. using UnityEngine;
  7. public class StoryE16P6 : BaseBehaviour
  8. {
  9. private bool e16Finish
  10. {
  11. set
  12. {
  13. SaveStorage.Set("E16_Finish", value);
  14. }
  15. }
  16. private void Start()
  17. {
  18. base.StartCoroutine(this.MainCoroutine());
  19. }
  20. private void OnDestroy()
  21. {
  22. CameraFilterUtils.Remove<CameraFilterPack_TV_Old_Movie_2>(null);
  23. CameraFilterUtils.Remove<CameraFilterPack_TV_BrokenGlass2>(null);
  24. CameraFilterUtils.Remove<CameraFilterPack_FB_AAA_Blood>(null);
  25. }
  26. private IEnumerator MainCoroutine()
  27. {
  28. this.gate.openType = SceneGate.OpenType.None;
  29. yield return new WaitForSeconds(3f);
  30. CameraFilterUtils.Create<CameraFilterPack_TV_Old_Movie_2>(null);
  31. this.text.text = ScriptLocalization.Story.e16s11;
  32. yield return DOTween.To(delegate(float a)
  33. {
  34. this.text.color = this.text.color.SetAlpha(a);
  35. }, 0f, 1f, 1.5f).WaitForCompletion();
  36. yield return new WaitForSeconds(1f);
  37. CameraFilterUtils.Remove<CameraFilterPack_TV_Old_Movie_2>(null);
  38. yield return R.Audio.PlayVoiceOver("e16t21", null, false);
  39. R.Audio.PlayEffect(466, null);
  40. YieldInstruction t22 = R.Audio.PlayVoiceOver("e16t22", null, false);
  41. if (UIAudioLanguage.IsChinese)
  42. {
  43. yield return new WaitForSeconds(12.23f);
  44. }
  45. else
  46. {
  47. yield return new WaitForSeconds(18.55f);
  48. }
  49. CameraFilterUtils.Create<CameraFilterPack_TV_BrokenGlass2>(null);
  50. CameraFilterUtils.Create<CameraFilterPack_FB_AAA_Blood>(null);
  51. yield return t22;
  52. R.Audio.PlayEffect(467, null);
  53. InputSetting.Stop(false);
  54. yield return new WaitForSeconds(1f);
  55. yield return R.Ui.Terminal.OpenWithAnim(new Color?(Color.green));
  56. yield return R.Ui.Terminal.Println(ScriptLocalization.Story.e16s12.Split(new char[]
  57. {
  58. '\n'
  59. })[0], 0.1f);
  60. yield return R.Ui.Terminal.PrintShellPrompt();
  61. yield return R.Ui.Terminal.Println(ScriptLocalization.Story.e16s12.Split(new char[]
  62. {
  63. '\n'
  64. })[1], 0.1f);
  65. yield return new WaitForSeconds(3f);
  66. R.Ui.Terminal.Clear();
  67. yield return R.Ui.Terminal.Println(ScriptLocalization.Story.e16s13, 0.1f);
  68. yield return new WaitForSeconds(1f);
  69. yield return R.Ui.Terminal.ShowProgressBar(0f);
  70. yield return R.Ui.Terminal.SetProgressBarValueWithAnim(1f, 3f);
  71. yield return new WaitForSeconds(1f);
  72. R.Ui.Terminal.HideProgressBar();
  73. R.Ui.Terminal.CloseWithoutAnim();
  74. R.Ui.BlackScene.Alpha = 1f;
  75. yield return new WaitForSeconds(3f);
  76. R.Ui.BlackScene.Alpha = 0f;
  77. yield return R.Ui.Terminal.OpenWithAnim(new Color?(Color.green));
  78. yield return R.Ui.Terminal.PrintShellPrompt();
  79. yield return R.Ui.Terminal.Println(ScriptLocalization.Story.e16s14, 0.1f);
  80. yield return new WaitForSeconds(1f);
  81. R.Ui.Terminal.CloseWithoutAnim();
  82. R.Ui.BlackScene.Alpha = 1f;
  83. this.e16Finish = true;
  84. R.Trophy.AwardTrophy(19);
  85. yield return SaveManager.ModifySaveData(delegate(GameData gameData)
  86. {
  87. if (gameData.ThisSaveValidStorage.ContainsKey("E16_Finish"))
  88. {
  89. gameData.ThisSaveValidStorage["E16_Finish"] = 1;
  90. }
  91. else
  92. {
  93. gameData.ThisSaveValidStorage.Add("E16_Finish", 1);
  94. }
  95. });
  96. yield return new WaitForSeconds(3f);
  97. yield return R.Audio.PlayVoiceOver("e16t23", null, false);
  98. CameraFilterUtils.Remove<CameraFilterPack_TV_BrokenGlass2>(null);
  99. CameraFilterUtils.Remove<CameraFilterPack_FB_AAA_Blood>(null);
  100. yield return new WaitForSeconds(1f);
  101. InputSetting.Resume(false);
  102. R.Ui.BlackScene.Alpha = 0f;
  103. yield return R.Ui.LevelSelect.OpenWithAnim(true, true);
  104. yield break;
  105. }
  106. [SerializeField]
  107. private SceneGate gate;
  108. [SerializeField]
  109. private TextMesh text;
  110. }