StoryE16P2.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. using System;
  2. using System.Collections;
  3. using Core;
  4. using I2.Loc;
  5. using UnityEngine;
  6. public class StoryE16P2 : BaseBehaviour
  7. {
  8. private bool p5
  9. {
  10. get
  11. {
  12. return RoundStorage.Get("E16_p5", false);
  13. }
  14. set
  15. {
  16. RoundStorage.Set("E16_p5", value);
  17. }
  18. }
  19. private bool p67
  20. {
  21. get
  22. {
  23. return RoundStorage.Get("E16_p56", false);
  24. }
  25. set
  26. {
  27. RoundStorage.Set("E16_p56", value);
  28. }
  29. }
  30. private bool e16log2
  31. {
  32. get
  33. {
  34. return RoundStorage.Get("E16_log2", false);
  35. }
  36. set
  37. {
  38. RoundStorage.Set("E16_log2", value);
  39. }
  40. }
  41. private void Start()
  42. {
  43. if (this.e16log2)
  44. {
  45. UnityEngine.Object.Destroy(this.detailUI);
  46. }
  47. }
  48. private void OnTriggerEnter2D(Collider2D other)
  49. {
  50. if (other.CompareTag("Player") && !this.p5)
  51. {
  52. this.p5 = true;
  53. base.StartCoroutine(this.LogEvent());
  54. }
  55. }
  56. private void OnTriggerStay2D(Collider2D other)
  57. {
  58. if (other.CompareTag("Player") && !this.p67 && Core.Input.Game.Search.OnClick && !this.showImg)
  59. {
  60. base.StartCoroutine(this.ShowImg());
  61. }
  62. }
  63. private IEnumerator LogEvent()
  64. {
  65. yield return R.Audio.PlayVoiceOver("e16t5", null, false);
  66. yield break;
  67. }
  68. private IEnumerator ShowImg()
  69. {
  70. this.showImg = true;
  71. this.e16log2 = true;
  72. R.Audio.PlayEffect(364, new Vector3?(R.Player.Transform.position));
  73. R.Audio.PlayVoiceOver("e16t6", null, false);
  74. yield return R.Ui.Terminal.OpenWithAnim(null);
  75. UnityEngine.Object.Destroy(this.detailUI);
  76. yield return R.Ui.Terminal.Println(ScriptLocalization.Story.e16log2, 0.1f);
  77. while (!Core.Input.AnyKey.OnClick)
  78. {
  79. yield return null;
  80. }
  81. base.StartCoroutine(this.HideImg());
  82. yield break;
  83. }
  84. private IEnumerator HideImg()
  85. {
  86. this.p67 = true;
  87. this.showImg = false;
  88. R.Audio.PlayEffect(372, new Vector3?(R.Player.Transform.position));
  89. YieldInstruction t7 = R.Audio.PlayVoiceOver("e16t7", null, false);
  90. yield return R.Ui.Terminal.CloseWithAnim();
  91. yield return t7;
  92. yield break;
  93. }
  94. private bool showImg;
  95. [SerializeField]
  96. private GameObject detailUI;
  97. }