コード例 #1
0
 protected override void OnCollided(PhysicsEntity other)
 {
     if (other is Asteroid)
     {
         isAlive = false;
     }
 }
コード例 #2
0
 protected override void OnCollided(PhysicsEntity other)
 {
     if (isAlive && other is Bullet)
     {
         isAlive = false;
         OnDead();
     }
 }
コード例 #3
0
        protected override void OnCollided(PhysicsEntity other)
        {
            if (isAlive && !isInvulnerable && other is Asteroid)
            {
                isAlive = false;

                var particle = GameplayState.instance.CreateAndRegisterEntity <DeathParticle>(deathParticleName);
                if (particle != null)
                {
                    particle.Init(transform.localPosition.x, transform.localPosition.y);
                }

                GameplayState.instance.LoseLife();
            }
        }
コード例 #4
0
 /// <summary>
 /// Triggered whenever another phyics entity collides with this one.
 /// </summary>
 protected virtual void OnCollided(PhysicsEntity other)
 {
 }