예제 #1
0
        public void Update(TimeSpan elapsed)
        {
            for (var i = 0; i < _collidables.Count; i++)
            {
                var collidable = _collidables[i];
                for (var j = 0; j < _collidables.Count; j++)
                {
                    var otherCollidable = _collidables[j];

                    if (IsCollisionDetected(collidable, otherCollidable))
                    {
                        OnCollisionDetected?.Invoke(this, collidable, otherCollidable);
                    }
                }
            }
        }
예제 #2
0
 public void OnCollision(CollisionEventArgs collisionInfo)
 {
     OnCollisionDetected?.Invoke(collisionInfo);
 }