StoryE26P2.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. using System;
  2. using System.Collections;
  3. using DG.Tweening;
  4. using I2.Loc;
  5. using UnityEngine;
  6. public class StoryE26P2 : BaseBehaviour
  7. {
  8. private bool e26finish
  9. {
  10. set
  11. {
  12. SaveStorage.Set("E26_Finish", value);
  13. }
  14. }
  15. private void Awake()
  16. {
  17. R.Ui.HideUI(false);
  18. SingletonMono<MobileInputPlayer>.Instance.Visible = false;
  19. }
  20. private void Start()
  21. {
  22. R.Player.ActionController.ChangeState(PlayerAction.StateEnum.Disappear);
  23. R.Camera.Controller.IsFollowPivot = false;
  24. R.Camera.Controller.MovableCamera.position = new Vector3(17f, 5f, -16f);
  25. base.StartCoroutine(this.P2Coroutine());
  26. }
  27. private void OnDestroy()
  28. {
  29. R.Player.ActionController.ChangeState(PlayerAction.StateEnum.Idle);
  30. R.Camera.Controller.IsFollowPivot = true;
  31. SingletonMono<MobileInputPlayer>.Instance.Visible = true;
  32. CameraFilterUtils.Remove<CameraFilterPack_FX_Glitch1>(null);
  33. CameraFilterUtils.Remove<CameraFilterPack_TV_Vcr>(null);
  34. CameraFilterUtils.Remove<CameraFilterPack_Color_Chromatic_Aberration>(null);
  35. CameraFilterUtils.Remove<CameraFilterPack_TV_ARCADE_2>(null);
  36. WorldTime.Resume();
  37. }
  38. private IEnumerator P2Coroutine()
  39. {
  40. R.Audio.PlayBGM(487, true);
  41. CameraFilterUtils.Create<CameraFilterPack_FX_Glitch1>(null);
  42. CameraFilterUtils.Create<CameraFilterPack_TV_Vcr>(null);
  43. CameraFilterUtils.Create<CameraFilterPack_TV_ARCADE_2>(null);
  44. yield return DOTween.To(() => this._blackPoint.color, delegate(Color color)
  45. {
  46. this._blackPoint.color = color;
  47. }, Color.clear, 7f).WaitForCompletion();
  48. R.Camera.Controller.CameraZoom(new Vector3(17f, 3f, -10f), 5f, 0f);
  49. yield return new WaitForSeconds(6f);
  50. yield return R.Camera.Controller.CameraMoveTo(new Vector3(21f, 3f, -10f), 1.5f, Ease.Linear);
  51. yield return new WaitForSeconds(1f);
  52. R.Camera.Controller.CameraMoveTo(new Vector3(15f, 3f, -10f), 1.5f, Ease.Linear);
  53. yield return new WaitForSeconds(1.2f);
  54. this._faust.state.SetAnimation(0, "IdleToCall", false);
  55. this._faust.state.AddAnimation(0, "Call", true, 0.33f);
  56. yield return new WaitForSeconds(0.33f);
  57. YieldInstruction e26t4 = R.Audio.PlayVoiceOver("e26t4", null, true);
  58. this._playerNormal.gameObject.SetActive(false);
  59. this._playerHurt.gameObject.SetActive(true);
  60. this._playerHurt.state.SetAnimation(0, "CallByFaust", false);
  61. this._playerChange.state.SetAnimation(0, "Play", false);
  62. yield return new WaitForSeconds(4f);
  63. yield return e26t4;
  64. WorldTime.Pause();
  65. CameraFilterUtils.Create<CameraFilterPack_Color_Chromatic_Aberration>(null);
  66. yield return WorldTime.WaitForSecondsIgnoreTimeScale(1.5f);
  67. CameraFilterUtils.Remove<CameraFilterPack_Color_Chromatic_Aberration>(null);
  68. WorldTime.Resume();
  69. SingletonMono<EffectController>.Instance.Generate(215, null, R.Camera.Transform.position, default(Vector3), default(Vector3), true);
  70. yield return new WaitForSeconds(0.15f);
  71. CameraFilterUtils.Remove<CameraFilterPack_FX_Glitch1>(null);
  72. CameraFilterUtils.Remove<CameraFilterPack_TV_Vcr>(null);
  73. CameraFilterUtils.Remove<CameraFilterPack_TV_ARCADE_2>(null);
  74. yield return new WaitForSeconds(1f);
  75. R.Audio.StopBGM(false);
  76. yield return R.Ui.Terminal.OpenWithAnim(null);
  77. yield return new WaitForSeconds(1f);
  78. yield return R.Ui.Terminal.PrintlnInstantly(ScriptLocalization.Story.e26s9);
  79. yield return new WaitForSeconds(1f);
  80. YieldInstruction e26t5 = R.Audio.PlayVoiceOver("e26t5", null, false);
  81. yield return R.Ui.Terminal.Println(ScriptLocalization.Story.e26s10, 0.1f);
  82. yield return e26t5;
  83. yield return new WaitForSeconds(1f);
  84. yield return R.Ui.Terminal.PrintlnInstantly(ScriptLocalization.Story.e26s11);
  85. yield return new WaitForSeconds(1f);
  86. yield return R.Ui.Terminal.CloseWithAnim();
  87. this.e26finish = true;
  88. yield return SaveManager.ModifySaveData(delegate(GameData gameData)
  89. {
  90. if (gameData.ThisSaveValidStorage.ContainsKey("E26_Finish"))
  91. {
  92. gameData.ThisSaveValidStorage["E26_Finish"] = 1;
  93. }
  94. else
  95. {
  96. gameData.ThisSaveValidStorage.Add("E26_Finish", 1);
  97. }
  98. });
  99. yield return R.Ui.LevelSelect.OpenWithAnim(true, true);
  100. yield break;
  101. }
  102. [SerializeField]
  103. private SpriteRenderer _blackPoint;
  104. [SerializeField]
  105. private SkeletonAnimation _faust;
  106. [SerializeField]
  107. private SkeletonAnimation _playerNormal;
  108. [SerializeField]
  109. private SkeletonAnimation _playerHurt;
  110. [SerializeField]
  111. private SkeletonAnimation _playerChange;
  112. }