protected override bool CheckHealth(Entity destroyer, float dropModifier) { if (HealthRatio > 0f) { return(false); } destroyerEntity = destroyer; dropModifierOnDeath = dropModifier; burning = true; burningEffects.SetActive(true); ActivateAllColliders(false); sprRend.sprite = burningSprite; for (int i = 0; i < enemies.Count; i++) { ICombat enemy = enemies[i]; enemy.DisengageInCombat(this); } EjectFromAllDrillers(true); return(base.CheckHealth(destroyer, dropModifier)); }
public override void DestroySelf(Entity destroyer, float dropModifier) { bool explode = destroyer != null; if (explode) { //particle effects GameObject explosion = Instantiate(explosionDeathObj, ParticleGenerator.holder); explosion.transform.position = transform.position; //sound effects } for (int i = 0; i < enemies.Count; i++) { ICombat enemy = enemies[i]; enemy.DisengageInCombat(this); } if (hive != null) { hive.BotDestroyed(this); } base.DestroySelf(destroyer, dropModifier); }