Exemplo n.º 1
0
 protected virtual void OnCollidedWithBullet(BaseBullet i_Bullet)
 {
     if (PlayerCollided != null)
     {
         PlayerCollided.Invoke(this, i_Bullet);
     }
 }
Exemplo n.º 2
0
        public override void Collided(ICollidable i_Collidable)
        {
            BaseBullet bullet = i_Collidable as BaseBullet;
            Enemy      enemy  = i_Collidable as Enemy;

            if (bullet != null)
            {
                OnCollidedWithBullet(bullet);
            }
            else if (enemy != null)
            {
                OnCollidedWithEnemy(enemy);
            }
        }