void OnTriggerExit(Collider c) { if (!IsPlayer(c)) { return; } PlayerLeave.Invoke(); // StopCoroutine("PlayerStayCaster"); StopAllCoroutines(); SendMessage(PlayerLeaveMessage, c, SendMessageOptions.DontRequireReceiver); }
void OnTriggerEnter(Collider c) { if (!IsPlayer(c)) { return; } PlayerDetected.Invoke(); //StartCoroutine("PlayerStayCaster",c); doesn't work...? StartCoroutine(PlayerStayCaster(c)); SendMessage(PlayerEnterMessage, c, SendMessageOptions.DontRequireReceiver); }
void OnTriggerEnter2D(Collider2D other) { playerDetectedEvent.Invoke(); }