Enemy atributes script

Hi there guys!

So, im new to c# scripting, and i want to know how do i create anything similar to an reference script. To be more clear, i want to create an script like :

public class EnemyAtributes:

public EnemyDragonAtributes 
{
   float enemyHealth = 10f;
   float enemy power = 20f;
   string enemyName = "Dragon";
}
public EnemyMageAtributes 
{
   float enemyHealth = 10f;
   float enemy power = 20f;
   string enemyName = "Mage";
}

and when i need that in code, on another script, ill use something like:

public class GameBaseScript:

void Update()
{
   float enemyHP = EnemyAtributes.EnemyDragonAtributes.enemyHealth;
}

Is there any way to do that? Basically is an script to store the information from all my monsters and when i need, ill use them on script, instead of creating lots of variables like “enemyDragonHp,EnemyMageHP,enemyDragonName,EnemyMageName,Enemy…”
Sorry for my english, im not too good at it !

What you need to do is to make the class that has these stats extend a MonoBehavior and then you can just attach them to said objects. The one thing that this will require is that to get the values inside of a different class you need to have a reference to them (which can be done many ways - simplest is just make a GameObject variable in a class in the script you use it and set that) and use GetComponent().health;

For example:

public class DragonAttributes : MonoBehavior
{
  public float health = 10f;
  public float enemyPower = 20f;
  public string enemyName = "Dragon";
}