public void SendTriggerEnter(BC_TriggerData data) { if (this.trigEnters != null) { for (int i = 0; i < this.trigEnters.Count; i++) { this.trigEnters[i].OnTriggerEnter(data); EventListener.TriggerEnter(data); // Invoke custom event } } }
void IBC_TriggerEnterListener.OnTriggerEnter(BC_TriggerData other) { if (this.coolDown > 0f || !this.exited) { return; } RoomSwitchable component = other.collider.GetComponent <RoomSwitchable>(); if (component != null) { this.coolDown = 20f; this.StartFadeout(component); } }
void IBC_TriggerExitListener.OnTriggerExit(BC_TriggerData other) { this.exited = true; }
public static void TriggerExit(BC_TriggerData data) { //DebugManager.LogToFile("[OnTriggerExit] " + data.collider.name + " exited collision with " + data.myCollider.name); OnTriggerExit?.Invoke(data); }
public static void TriggerStay(BC_TriggerData data) { //DebugManager.LogToFile("[OnTriggerStay] " + data.collider.name + " is colliding with " + data.myCollider.name); OnTriggerStay?.Invoke(data); }