StoryE16P5.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. using System;
  2. using System.Collections;
  3. using System.Text.RegularExpressions;
  4. using Core;
  5. using I2.Loc;
  6. using UnityEngine;
  7. public class StoryE16P5 : BaseBehaviour
  8. {
  9. private void Start()
  10. {
  11. this.gate1.openType = SceneGate.OpenType.None;
  12. this.gate2.openType = SceneGate.OpenType.None;
  13. base.StartCoroutine(this.P14Coroutine());
  14. }
  15. private void OnDestroy()
  16. {
  17. SingletonMono<MobileInputPlayer>.Instance.HideL2R2(true);
  18. }
  19. private void SetMenu(string l, string r)
  20. {
  21. this._phone.LeftBtn = l;
  22. this._phone.RightBtn = r;
  23. Regex regex = new Regex("<size=\\d+>|</size>");
  24. SingletonMono<MobileInputPlayer>.Instance.ShowL2R2(regex.Replace(l, string.Empty), regex.Replace(r, string.Empty));
  25. }
  26. private IEnumerator P14Coroutine()
  27. {
  28. R.Audio.PlayBGM(354, true);
  29. yield return new WaitForSeconds(3f);
  30. this._phone.Name = ScriptLocalization.Story.e16s2;
  31. this._phone.InCall();
  32. SingletonMono<MobileInputPlayer>.Instance.MainControllerVisiable = false;
  33. this.SetMenu(string.Empty, string.Empty);
  34. yield return R.Audio.PlayVoiceOver("e16t13", null, false);
  35. this.SetMenu(ScriptLocalization.mobile.e16s3, ScriptLocalization.mobile.e16s4);
  36. while (!Core.Input.Game.L2.OnPressed)
  37. {
  38. if (Core.Input.Game.R2.OnPressed)
  39. {
  40. SingletonMono<MobileInputPlayer>.Instance.HideL2R2(false);
  41. base.StartCoroutine(this.P20Coroutine());
  42. yield break;
  43. }
  44. yield return null;
  45. }
  46. SingletonMono<MobileInputPlayer>.Instance.HideL2R2(false);
  47. base.StartCoroutine(this.P15Coroutine());
  48. yield break;
  49. }
  50. private IEnumerator P15Coroutine()
  51. {
  52. yield return R.Audio.PlayVoiceOver("e16t15", null, false);
  53. this.SetMenu(ScriptLocalization.mobile.e16s5, ScriptLocalization.mobile.e16s6);
  54. while (!Core.Input.Game.L2.OnPressed)
  55. {
  56. if (Core.Input.Game.R2.OnPressed)
  57. {
  58. SingletonMono<MobileInputPlayer>.Instance.HideL2R2(false);
  59. base.StartCoroutine(this.P15UnsureCoroutine());
  60. yield break;
  61. }
  62. yield return null;
  63. }
  64. SingletonMono<MobileInputPlayer>.Instance.HideL2R2(false);
  65. base.StartCoroutine(this.P16Coroutine());
  66. yield break;
  67. }
  68. private IEnumerator P16Coroutine()
  69. {
  70. yield return R.Audio.PlayVoiceOver("e16t16", null, false);
  71. this.SetMenu(ScriptLocalization.mobile.e16s7, ScriptLocalization.mobile.e16s8);
  72. while (!Core.Input.Game.L2.OnPressed)
  73. {
  74. if (Core.Input.Game.R2.OnPressed)
  75. {
  76. SingletonMono<MobileInputPlayer>.Instance.HideL2R2(false);
  77. base.StartCoroutine(this.P15UnsureCoroutine());
  78. yield break;
  79. }
  80. yield return null;
  81. }
  82. SingletonMono<MobileInputPlayer>.Instance.HideL2R2(false);
  83. base.StartCoroutine(this.P17Coroutine());
  84. yield break;
  85. }
  86. private IEnumerator P17Coroutine()
  87. {
  88. yield return R.Audio.PlayVoiceOver("e16t17", null, false);
  89. yield return new WaitForSeconds(R.Audio.PlayEffect(353, null).clip.length);
  90. this.SetMenu(ScriptLocalization.mobile.e16s9, ScriptLocalization.mobile.e16s10);
  91. yield return new WaitForSeconds(1.5f);
  92. while (!Core.Input.Game.L2.OnPressed && !Core.Input.Game.R2.OnPressed)
  93. {
  94. yield return null;
  95. }
  96. SingletonMono<MobileInputPlayer>.Instance.HideL2R2(false);
  97. base.StartCoroutine(this.P19Coroutine());
  98. yield break;
  99. }
  100. private IEnumerator P19Coroutine()
  101. {
  102. yield return R.Audio.PlayVoiceOver("e16t19", null, false);
  103. this.SetMenu(ScriptLocalization.mobile.e16s4, ScriptLocalization.mobile.e16s4);
  104. while (!Core.Input.Game.L2.OnPressed && !Core.Input.Game.R2.OnPressed)
  105. {
  106. yield return null;
  107. }
  108. SingletonMono<MobileInputPlayer>.Instance.HideL2R2(false);
  109. base.StartCoroutine(this.P20Coroutine());
  110. yield break;
  111. }
  112. private IEnumerator P20Coroutine()
  113. {
  114. R.Audio.StopBGM(true);
  115. this._phone.CallEnd(false);
  116. SingletonMono<MobileInputPlayer>.Instance.MainControllerVisiable = true;
  117. yield return R.Audio.PlayVoiceOver("e16t20", null, false);
  118. this.gate1.openType = SceneGate.OpenType.Right;
  119. yield break;
  120. }
  121. private IEnumerator P15UnsureCoroutine()
  122. {
  123. yield return R.Audio.PlayVoiceOver("e16t24", null, false);
  124. this.SetMenu(ScriptLocalization.mobile.e16s3, ScriptLocalization.mobile.e16s4);
  125. while (!Core.Input.Game.L2.OnPressed)
  126. {
  127. if (Core.Input.Game.R2.OnPressed)
  128. {
  129. SingletonMono<MobileInputPlayer>.Instance.HideL2R2(false);
  130. base.StartCoroutine(this.P20Coroutine());
  131. yield break;
  132. }
  133. yield return null;
  134. }
  135. SingletonMono<MobileInputPlayer>.Instance.HideL2R2(false);
  136. base.StartCoroutine(this.P15Coroutine());
  137. yield break;
  138. }
  139. [SerializeField]
  140. private PhoneController _phone;
  141. [SerializeField]
  142. private SceneGate gate1;
  143. [SerializeField]
  144. private SceneGate gate2;
  145. }