StoryE3P1.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using System;
  2. using System.Collections;
  3. using UnityEngine;
  4. [RequireComponent(typeof(BoxCollider2D))]
  5. public class StoryE3P1 : BaseBehaviour
  6. {
  7. private static bool IsFirstE3P1
  8. {
  9. get
  10. {
  11. return RoundStorage.Get("E3_p1", true);
  12. }
  13. set
  14. {
  15. RoundStorage.Set("E3_p1", value);
  16. }
  17. }
  18. private static bool GuideBoardActive
  19. {
  20. get
  21. {
  22. return RoundStorage.Get("E3_guideBoardActive", false);
  23. }
  24. set
  25. {
  26. RoundStorage.Set("E3_guideBoardActive", value);
  27. }
  28. }
  29. private void OnTriggerEnter2D(Collider2D collision)
  30. {
  31. if (collision.CompareTag("Player") && !this._supplyBoxAction.Opened && StoryE3P1.IsFirstE3P1)
  32. {
  33. StoryE3P1.IsFirstE3P1 = false;
  34. base.StartCoroutine(this.Sequcence0());
  35. base.StartCoroutine(this.Sequcence1());
  36. }
  37. }
  38. private void Start()
  39. {
  40. this._guideArrow.SetActive(StoryE3P1.GuideBoardActive);
  41. }
  42. private IEnumerator Sequcence0()
  43. {
  44. this._battleZoneGate.Appear();
  45. yield return R.Audio.PlayVoiceOver("e3t1", null, false);
  46. yield break;
  47. }
  48. private IEnumerator Sequcence1()
  49. {
  50. yield return this._supplyBoxAction.WaitForBreak();
  51. yield return R.Audio.PlayVoiceOver("e3t2", null, false);
  52. this._battleZoneGate.DisAppear();
  53. StoryE3P1.GuideBoardActive = true;
  54. this._guideArrow.SetActive(true);
  55. yield break;
  56. }
  57. [SerializeField]
  58. private SupplyBoxAction _supplyBoxAction;
  59. [SerializeField]
  60. private BattleZoneGate _battleZoneGate;
  61. [SerializeField]
  62. private GameObject _guideArrow;
  63. }