Some of the enemies in my game can’t use the base enemy script because they have mechanics too different from a normal enemy, which means I have to make a new script for each enemy that’s like this. So my problem is in killing the enemy because I need to destroy the script on them, but how do I know what enemy script they have? I could do something like this for each script
if ( enemy.GetComponent<FirstBoss>() )
{
Destroy(enemy.GetComponent<FirstBoss>());
}
but obviously that is a horrible way to do it. How would I efficiently check for what script the enemy has in a sustainable way (sustainable as in I wouldn’t have to do any considerable work to make the code still work).