Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2025
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. public class HutTrigger : MonoBehaviour
  4. {
  5. public DayNightCycle dayNightCycle;
  6.  
  7. private void OnTriggerEnter(Collider other)
  8. {
  9. Debug.Log("Something entered the hut trigger: " + other.name);
  10. if (other.CompareTag("Player"))
  11. {
  12. Debug.Log("Player entered the hut trigger.");
  13. if (dayNightCycle != null)
  14. {
  15. Debug.Log("Calling PlayerReachedHut() in DayNightCycle.");
  16. dayNightCycle.PlayerReachedHut();
  17. }
  18. else
  19. {
  20. Debug.Log("dayNightCycle reference is null.");
  21. }
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement