StoryE19P1.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. using System;
  2. using System.Collections;
  3. using Core;
  4. using UnityEngine;
  5. public class StoryE19P1 : BaseBehaviour
  6. {
  7. private bool p1
  8. {
  9. get
  10. {
  11. return RoundStorage.Get("E19_P1", false);
  12. }
  13. set
  14. {
  15. RoundStorage.Set("E19_P1", value);
  16. }
  17. }
  18. private bool e19elevator
  19. {
  20. get
  21. {
  22. return RoundStorage.Get("E19_Elevator", false);
  23. }
  24. set
  25. {
  26. RoundStorage.Set("E19_Elevator", value);
  27. }
  28. }
  29. private void Start()
  30. {
  31. if (!this.e19elevator)
  32. {
  33. base.StartCoroutine(this.MainCoroutine());
  34. }
  35. }
  36. private void OnTriggerEnter2D(Collider2D other)
  37. {
  38. if (other.CompareTag("Player") && this.p1 && !this.e19elevator)
  39. {
  40. this.detailUI.SetActive(true);
  41. this.showHint = true;
  42. }
  43. }
  44. private void OnTriggerExit2D(Collider2D other)
  45. {
  46. if (other.CompareTag("Player") && this.p1 && !this.e19elevator)
  47. {
  48. this.showHint = false;
  49. }
  50. }
  51. private IEnumerator MainCoroutine()
  52. {
  53. while (Mathf.Abs(R.Player.Transform.position.x - this.triggerPoint.position.x) > 1f)
  54. {
  55. yield return null;
  56. }
  57. yield return R.Audio.PlayVoiceOver("e19t1", null, false);
  58. yield return new WaitForSeconds(10f);
  59. yield return R.Audio.PlayVoiceOver("e19t2", null, false);
  60. yield return new WaitForSeconds(10f);
  61. yield return R.Audio.PlayVoiceOver("e19t3", null, false);
  62. yield return new WaitForSeconds(10f);
  63. this.p1 = true;
  64. while (!this.showHint || !Core.Input.Game.Search.OnClick)
  65. {
  66. yield return null;
  67. }
  68. InputSetting.Stop(false);
  69. R.Audio.StopBGM(true);
  70. R.Ui.BlackScene.Alpha = 1f;
  71. yield return R.Audio.PlayVoiceOver("e19t4", null, false);
  72. R.Audio.PlayEffect(373, null);
  73. yield return new WaitForSeconds(5f);
  74. this.e19elevator = true;
  75. InputSetting.Resume(false);
  76. this.outGate.Enter(false);
  77. yield break;
  78. }
  79. [SerializeField]
  80. private GameObject detailUI;
  81. [SerializeField]
  82. private Transform triggerPoint;
  83. private bool showHint;
  84. [SerializeField]
  85. private SceneGate outGate;
  86. }