Trigger - waits for someone to enter the trigger or collider and then, if the object matches the tag, invoke events.
Use Tags Limit - enables tags limit.
Allowed Tags - allows you to select which tags to work.
On Enter Trigger (GameObject) - event called when somebody enters a trigger or collider.
On Exit Trigger (GameObject) - event called when somebody left a trigger or collider.
QUESTIONS: 1. How to subscribe events? - Get the link in a convenient way and subscribe to events.
[SerializeField] private Trigger _trigger;
private void Start()
{
_trigger.OnEnterTrigger.AddListener(OnEnterTrigger);
_trigger.OnExitTrigger.AddListener(OnExitTrigger);
}
private void OnEnterTrigger(GameObject go)
{
//Do something...
}
private void OnExitTrigger(GameObject go)
{
//Do something...
}