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