Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class GenericTrigger2D : MonoBehaviour
- {
- // Add here any tags you want the trigger to ignore. Leave empty to allow all
- public List<string> ignoreTags = new List<string> { };
- private Collider2D collider;
- void Start(){
- collider = GetComponent<Collider2D>();
- }
- void OnTriggerEnter2D(Collider2D coll)
- {
- if (!ignoreTags.Contains(coll.gameObject.tag))
- {
- Debug.Log("Raising event");
- Fungus.FungusManager.Instance.EventDispatcher.Raise(new Custom_EventHandler_Trigger2D.Custom_EventHandlerEvent() { hitObject = coll, source = collider });
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement