private void OnTriggerExit(Collider other) { if (other.attachedRigidbody && other.attachedRigidbody.CompareTag("Player")) { OnPlayerExit.Invoke(); } }
private void OnTriggerExit(Collider other) { if (other.tag == "Player") { OnPlayerExit.Invoke(); } }
void OnTriggerExit(Collider other) { If(other.GetComponent <PlayerController>()) { OnPlayerExit?.Invoke(gridPosition); } }
private void OnTriggerExit(Collider other) { if (other.CompareTag("Player")) { OnPlayerExit?.Invoke(); } }
private void OnTriggerExit2D(Collider2D collider) { if (collider.tag == "Player") { Debug.Log("Player is leaving the zone"); OnPlayerExit?.Invoke(this, EventArgs.Empty); } }
private void OnTriggerExit(Collider other) { if (other.CompareTag("Player")) { Debug.Log("Player left area"); OnPlayerExit?.Invoke(); } }
/// <summary> /// When player exit, disable teleporters and kill ennemies (if any) to reduce lag and remove events /// </summary> public void PlayerExit() { TeleporterManager tpm = teleportersExit.GetComponent <TeleporterManager>(); tpm.SetPlayerHere(false); OnPlayerExit?.Invoke(this, EventArgs.Empty); }
public void Update() { var lastplayerrect = new Rectangle(Main.player.lastPosition.ToPoint(), new Point(50, 50)); if (Main.player.rect.Intersects(bounds)) { OnPlayerInside?.Invoke(); } if (Main.player.rect.Intersects(bounds) && !lastplayerrect.Intersects(bounds)) { OnPlayerEnter?.Invoke(); } if (!Main.player.rect.Intersects(bounds) && lastplayerrect.Intersects(bounds)) { OnPlayerExit?.Invoke(); } }
protected virtual void OnDestroy() { OnPlayerExit?.Invoke(); }