StoryE16P4.cs 2.6 KB

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