StoryE16P1.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. using System;
  2. using System.Collections;
  3. using Core;
  4. using I2.Loc;
  5. using UnityEngine;
  6. public class StoryE16P1 : BaseBehaviour
  7. {
  8. private bool p1
  9. {
  10. get
  11. {
  12. return RoundStorage.Get("E16_p1", false);
  13. }
  14. set
  15. {
  16. RoundStorage.Set("E16_p1", value);
  17. }
  18. }
  19. private bool p2
  20. {
  21. get
  22. {
  23. return RoundStorage.Get("E16_p2", false);
  24. }
  25. set
  26. {
  27. RoundStorage.Set("E16_p2", value);
  28. }
  29. }
  30. private bool p34
  31. {
  32. get
  33. {
  34. return RoundStorage.Get("E16_p34", false);
  35. }
  36. set
  37. {
  38. RoundStorage.Set("E16_p34", value);
  39. }
  40. }
  41. private bool e16log1
  42. {
  43. get
  44. {
  45. return RoundStorage.Get("E16_Log1", false);
  46. }
  47. set
  48. {
  49. RoundStorage.Set("E16_Log1", value);
  50. }
  51. }
  52. private void Start()
  53. {
  54. if (!this.p1)
  55. {
  56. base.StartCoroutine(this.P1Coroutine());
  57. }
  58. if (this.e16log1)
  59. {
  60. UnityEngine.Object.Destroy(this.detailUI);
  61. }
  62. }
  63. private IEnumerator P1Coroutine()
  64. {
  65. this.p1 = true;
  66. yield return R.Audio.PlayVoiceOver("e16t1", null, false);
  67. yield break;
  68. }
  69. private void OnTriggerEnter2D(Collider2D other)
  70. {
  71. if (other.CompareTag("Player") && !this.p2)
  72. {
  73. this.p2 = true;
  74. base.StartCoroutine(this.LogEvent());
  75. }
  76. }
  77. private void OnTriggerStay2D(Collider2D other)
  78. {
  79. if (other.CompareTag("Player") && !this.p34 && Core.Input.Game.Search.OnClick && !this.showImg)
  80. {
  81. base.StartCoroutine(this.ShowImg());
  82. }
  83. }
  84. private IEnumerator LogEvent()
  85. {
  86. yield return R.Audio.PlayVoiceOver("e16t2", null, false);
  87. yield break;
  88. }
  89. private IEnumerator ShowImg()
  90. {
  91. this.showImg = true;
  92. R.Audio.PlayEffect(364, new Vector3?(R.Player.Transform.position));
  93. this.e16log1 = true;
  94. R.Audio.PlayVoiceOver("e16t3", null, false);
  95. yield return R.Ui.Terminal.OpenWithAnim(null);
  96. UnityEngine.Object.Destroy(this.detailUI);
  97. yield return R.Ui.Terminal.Println(ScriptLocalization.Story.e16log1, 0.1f);
  98. while (!Core.Input.AnyKey.OnClick)
  99. {
  100. yield return null;
  101. }
  102. base.StartCoroutine(this.HideImg());
  103. yield break;
  104. }
  105. private IEnumerator HideImg()
  106. {
  107. this.p34 = true;
  108. this.showImg = false;
  109. R.Audio.PlayEffect(372, new Vector3?(R.Player.Transform.position));
  110. YieldInstruction t4 = R.Audio.PlayVoiceOver("e16t4", null, false);
  111. yield return R.Ui.Terminal.CloseWithAnim();
  112. yield return t4;
  113. yield break;
  114. }
  115. private bool showImg;
  116. [SerializeField]
  117. private GameObject detailUI;
  118. }