Hi all. I would like to know which way is the most standard to show collections like weapon types,names, items, etc?
public enum WeaponType{
None=-1,
Weapon1,
Weapon2
}
public class WeaponType{
public static string weapon1{get{return "Weapon1"}}
public static string weapon2{get{return "Weapon2"}}
}
public class WeaponType{
public const string weapon1= "Weapon1";
public const string weapon2= "Weapon2";
}
//define inside weapon class
public class Weapon{
public const string weapon1= "Weapon1";
public const string weapon2= "Weapon2";
}
//define inside weapon class
public class Weapon{
public static string weapon1{get{return "Weapon1"}}
public static string weapon2{get{return "Weapon2"}}
}
If I use enum, I need to write “[SerializeField] WeaponType type” and If I change, add or remove types in the enum, I need to correct all of them. (ugly solution is to bind enums to numbers), so I can add and remove them without requiring to assign them again.
If I use strings, I need to write “[SerializeField] string type” and if I change the type name, I have to correct it.
The final way is to use ScriptableObject in unity