protected virtual void OnCollidedWithEnemy(Enemy i_Enemy) { if (PlayerCollided != null) { PlayerCollided.Invoke(this, i_Enemy); } }
protected virtual void OnCollidedWithBullet(BaseBullet i_Bullet) { if (PlayerCollided != null) { PlayerCollided.Invoke(this, i_Bullet); } }
private void player_Collided(BasePlayer i_Player, ICollidable2D i_CollidedWith) { if (PlayerCollided != null) { PlayerCollided.Invoke(i_Player, i_CollidedWith); } }
private void OnTriggerEnter(Collider other) { var element = other.gameObject.GetComponent <Element>(); if (element != null) { switch (element.ElementType) { case ElementType.Obstacle: { if (PlayerCollided != null) { PlayerCollided.Invoke(); } Freeze(); } break; case ElementType.Collectible: { if (CollectibleCollected != null) { CollectibleCollected.Invoke(other.gameObject); } } break; } } }
private void OnCollisionEnter(Collision collision) { if (!collision.collider.CompareTag("obstacle")) { return; } PlayerCollided?.Invoke(this); gameManager.EndGame(); }
public void OnChildCollision() { PlayerCollided.Invoke(); }