How can i get a unknow GetComponent??

If there are too many characters in the scene, they are also a characters inheritance from charater_base
script and they are different name of script for different skill (Lily script , Peter script , Join script …)
But the bullet script can only GetComponent with a single script to active the function “Take_Damage” in the character_base script. If all the character is tag with “chara” . Is there are some anyway for solve this problem?

thankyou for your reply

I don’t quite get the issue. If you have all those script derived from your “charater_base” class and the TakeDamage method is declared in that base class, why don’t you just do

var character = GetComponent<charater_base>();
if (character != null)
    character.TakeDamage(10);

That’s the whole point of having inheritance. So you can treat derived classes like a base class instance since it actually is a “charater_base” instance as well.