StoryRO.cs 404 B

123456789101112131415161718192021
  1. using System;
  2. using UnityEngine;
  3. public class StoryRO : MonoBehaviour
  4. {
  5. private void OnDestroy()
  6. {
  7. SingletonMono<UIROController>.Instance.Hide();
  8. }
  9. private void OnTriggerEnter2D(Collider2D collision)
  10. {
  11. if (collision.CompareTag("Player") && !this._hasShown)
  12. {
  13. SingletonMono<UIROController>.Instance.Show();
  14. this._hasShown = true;
  15. }
  16. }
  17. private bool _hasShown;
  18. }