StoryE9P2.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using System;
  2. using UnityEngine;
  3. [RequireComponent(typeof(BoxCollider2D))]
  4. public class StoryE9P2 : BaseBehaviour
  5. {
  6. private bool IsE9P2FirstBossNotDie
  7. {
  8. get
  9. {
  10. return RoundStorage.Get("E9_P2BossNotDie", true);
  11. }
  12. set
  13. {
  14. RoundStorage.Set("E9_P2BossNotDie", value);
  15. }
  16. }
  17. private bool IsE9P2FirstBossDie
  18. {
  19. get
  20. {
  21. return RoundStorage.Get("E9_P2BossDie", true);
  22. }
  23. set
  24. {
  25. RoundStorage.Set("E9_P2BossDie", value);
  26. }
  27. }
  28. private bool IsE9BossDie
  29. {
  30. get
  31. {
  32. return RoundStorage.Get("E9_BossDie", false);
  33. }
  34. }
  35. private void Start()
  36. {
  37. this.guideLeft.SetActive(!this.IsE9BossDie);
  38. this.guideRight.SetActive(this.IsE9BossDie);
  39. }
  40. public void OnTriggerEnter2D(Collider2D collision)
  41. {
  42. if (!collision.CompareTag("Player"))
  43. {
  44. return;
  45. }
  46. if (this.IsE9P2FirstBossNotDie && !this.IsE9BossDie)
  47. {
  48. this.IsE9P2FirstBossNotDie = false;
  49. R.Audio.PlayVoiceOver("e9t2", null, false);
  50. }
  51. if (this.IsE9P2FirstBossDie && this.IsE9BossDie)
  52. {
  53. this.IsE9P2FirstBossDie = false;
  54. R.Audio.PlayVoiceOver("e9t3", null, false);
  55. }
  56. }
  57. [SerializeField]
  58. private GameObject guideLeft;
  59. [SerializeField]
  60. private GameObject guideRight;
  61. }