Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class HutTrigger : MonoBehaviour
- {
- public DayNightCycle dayNightCycle;
- private void OnTriggerEnter(Collider other)
- {
- Debug.Log("Something entered the hut trigger: " + other.name);
- if (other.CompareTag("Player"))
- {
- Debug.Log("Player entered the hut trigger.");
- if (dayNightCycle != null)
- {
- Debug.Log("Calling PlayerReachedHut() in DayNightCycle.");
- dayNightCycle.PlayerReachedHut();
- }
- else
- {
- Debug.Log("dayNightCycle reference is null.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement