Beispiel #1
0
 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();
     }
 }
Beispiel #3
0
 void OnTriggerExit(Collider other)
 {
     If(other.GetComponent <PlayerController>())
     {
         OnPlayerExit?.Invoke(gridPosition);
     }
 }
 private void OnTriggerExit(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         OnPlayerExit?.Invoke();
     }
 }
Beispiel #5
0
 private void OnTriggerExit2D(Collider2D collider)
 {
     if (collider.tag == "Player")
     {
         Debug.Log("Player is leaving the zone");
         OnPlayerExit?.Invoke(this, EventArgs.Empty);
     }
 }
Beispiel #6
0
 private void OnTriggerExit(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         Debug.Log("Player left area");
         OnPlayerExit?.Invoke();
     }
 }
Beispiel #7
0
    /// <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);
    }
Beispiel #8
0
        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();
 }