Base_Spirits.cs 696 B

12345678910111213141516171819202122232425262728
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class Base_Spirits : MonoBehaviour
  5. {
  6. public GameObject buttons;
  7. private void OnTriggerEnter(Collider other)
  8. {
  9. if (other.gameObject.layer == 6)
  10. {
  11. PlayerController pc = other.GetComponent<PlayerController>();
  12. pc.isBaseBtnOut = true;
  13. buttons.SetActive(true);
  14. }
  15. }
  16. private void OnTriggerExit(Collider other)
  17. {
  18. if (other.gameObject.layer == 6)
  19. {
  20. PlayerController pc = other.GetComponent<PlayerController>();
  21. pc.isBaseBtnOut = false;
  22. buttons.SetActive(false);
  23. }
  24. }
  25. }