StoryE18P2.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. using System;
  2. using System.Collections;
  3. using I2.Loc;
  4. using UnityEngine;
  5. public class StoryE18P2 : BaseBehaviour
  6. {
  7. private bool p7
  8. {
  9. get
  10. {
  11. return RoundStorage.Get("E18_P7", false);
  12. }
  13. set
  14. {
  15. RoundStorage.Set("E18_P7", value);
  16. }
  17. }
  18. private void Start()
  19. {
  20. if (this.p7)
  21. {
  22. base.StartCoroutine(this.P2Coroutine());
  23. }
  24. }
  25. private void Update()
  26. {
  27. if (R.Player.StateMachine.currentState == "Fall1" && !this._fall && this.p7)
  28. {
  29. this._fall = true;
  30. base.StartCoroutine(this.FallCoroutine());
  31. }
  32. }
  33. private IEnumerator P2Coroutine()
  34. {
  35. R.Player.GetComponent<PlayerInput>().battlePause = true;
  36. R.Audio.PlayBGM(262, true);
  37. CameraFilterUtils.Create<CameraFilterPack_TV_Chromatical2>(null);
  38. this._gate.openType = SceneGate.OpenType.None;
  39. yield return R.Audio.PlayVoiceOver("e18t14", null, false);
  40. yield break;
  41. }
  42. private IEnumerator FallCoroutine()
  43. {
  44. R.Audio.StopVoiceOver();
  45. yield return new WaitForSeconds(0.2f);
  46. R.Camera.Controller.IsFollowPivot = false;
  47. InputSetting.Stop(false);
  48. R.Player.GetComponent<PlayerInput>().battlePause = false;
  49. yield return new WaitForSeconds(0.5f);
  50. R.Player.ActionController.ChangeState(PlayerAction.StateEnum.UnderAtkHitToFly);
  51. R.Player.Transform.GetComponent<PlayerAnimEventListener>().getUp = false;
  52. while (R.Player.Transform.position.y > this._trigger.position.y)
  53. {
  54. yield return null;
  55. }
  56. R.Audio.PlayEffect(357, new Vector3?(base.transform.position));
  57. R.Ui.BlackScene.Alpha = 1f;
  58. R.Audio.StopBGM(true);
  59. CameraFilterUtils.Remove<CameraFilterPack_TV_Chromatical2>(null);
  60. yield return new WaitForSeconds(3f);
  61. R.Camera.Controller.IsFollowPivot = true;
  62. R.Audio.PlayEffect(386, new Vector3?(base.transform.position));
  63. yield return new WaitForSeconds(3f);
  64. R.Ui.BlackScene.Alpha = 0f;
  65. yield return R.Ui.Terminal.OpenWithAnim(null);
  66. yield return R.Ui.Terminal.Println(ScriptLocalization.Story.e18s5, 0.1f);
  67. yield return new WaitForSeconds(3f);
  68. yield return R.Ui.Terminal.CloseWithAnim();
  69. R.Player.Transform.GetComponent<PlayerAnimEventListener>().getUp = true;
  70. InputSetting.Resume(false);
  71. yield return R.Ui.LevelSelect.OpenWithAnim(true, true);
  72. yield break;
  73. }
  74. private void OnDestroy()
  75. {
  76. R.Camera.Controller.IsFollowPivot = true;
  77. InputSetting.Resume(false);
  78. CameraFilterUtils.Remove<CameraFilterPack_TV_Chromatical2>(null);
  79. R.Player.Transform.GetComponent<PlayerAnimEventListener>().getUp = true;
  80. R.Player.GetComponent<PlayerInput>().battlePause = false;
  81. }
  82. [SerializeField]
  83. private SceneGate _gate;
  84. [SerializeField]
  85. private Transform _trigger;
  86. private bool _fall;
  87. }