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 !
↧