/// <summary> /// A Unit has been shot by the player /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnUnitShot(object sender, CollisionDetectedEventArgs e) { // VFX of PassiveEnemy (Asteroid) / ActiveEnemy (Saucer) EnemyUnit unit = e.EnemyUnit; unit.Collide(); // Player scored OnScored(sender, e); // TODO Add nice animation with the Points Scored }
/// <summary> /// An Active/Passive unit has been collided (by the player) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnEntityCollided(object sender, CollisionDetectedEventArgs e) { // VFX of PassiveEnemy (Asteroid) / ActiveEnemy (UFO) EnemyUnit unit = e.EnemyUnit; if (unit == null) { return; // TODO: Recheck, this should not happen... } unit.Collide(); // Player Collision e.SourceEntity.Collide(unit.Damage); }