コード例 #1
0
ファイル: ExplosionLogic.cs プロジェクト: Jypeli-JYU/Jypeli
        void OnCollided(object sender, CollisionEventArgs e)
        {
            if (e.Other.IgnoresPhysicsLogics ||
                Scalar.IsPositiveInfinity(e.Other.Mass.Mass))
            {
                return;
            }
            IExplosionAffectable affectable = e.Other.Shape as IExplosionAffectable;

            if (affectable != null)
            {
                Wrapper wrapper = new Wrapper();
                wrapper.body       = e.Other;
                wrapper.affectable = affectable;
                items.Add(wrapper);
            }
        }