StoryE16P3.cs 2.1 KB

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