Exemplo n.º 1
0
 protected override void OnCollided(PhysicsEntity other)
 {
     if (other is Asteroid)
     {
         isAlive = false;
     }
 }
Exemplo n.º 2
0
 protected override void OnCollided(PhysicsEntity other)
 {
     if (isAlive && other is Bullet)
     {
         isAlive = false;
         OnDead();
     }
 }
Exemplo n.º 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();
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Triggered whenever another phyics entity collides with this one.
 /// </summary>
 protected virtual void OnCollided(PhysicsEntity other)
 {
 }