Initial commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
public class SceneloaderEventSystem : MonoBehaviour
|
||||
{
|
||||
[SerializeField] string tagFilter;
|
||||
|
||||
[SerializeField] UnityEvent onTriggerEnter;
|
||||
[SerializeField] UnityEvent onTriggerExit;
|
||||
void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(tagFilter) && !other.gameObject.CompareTag(tagFilter)) return;
|
||||
onTriggerEnter.Invoke();
|
||||
}
|
||||
void OnTriggerExit(Collider other)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(tagFilter) && !other.gameObject.CompareTag(tagFilter)) return;
|
||||
onTriggerExit.Invoke();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user