예제 #1
0
        private void ShotCollision(object sender, CollisionEventArgs e)
        {
            if (e.OtherEntity(this) is Player)
            {
                return;
            }
            if (e.OtherEntity(this) is Shot)
            {
                return;
            }

            ShotCollisionEventArgs args = new ShotCollisionEventArgs
            {
                Shot        = this,
                OtherEntity = e.OtherEntity(this)
            };

            OnShotCollision?.Invoke(this, args);
            this.DestroyEntity();
        }
예제 #2
0
 private void ShotOnCollision(object sender, ShotCollisionEventArgs e)
 {
     OnShotCollision?.Invoke(sender, e);
 }