I’m not entirely sure if this is the most accurate way (or place) to ask this question and I will edit it to make it more accurate as I get new info, but I’m doing my best.
I want to make a scriptable object for creating ammo data for firearms in a project of mine. I want to store the data for the caliber of the ammo so I can check if its compatible for mags/guns.
public enum AmmoCaliber
{
//.300BLK
//5.56x45
//7.62x39
//5.45x39
//7.62x51
//9x19
//.50BMG
//12 gauge
//40VOG
//40x46
}
public enum SpecialEffect
{
Explosive,
APHE,
Incendiary,
TracerRed,
TracerGreen
}
[CreateAssetMenu(fileName = "Ammo", menuName = "Weapons/Ammo", order = 2)]
public class AmmoData : ScriptableObject
{
//public AmmoCaliber Caliber;
public float Damage;
public float ArmorPiercing;
public float MuzzleVelocity;
[NonReorderable]
public List<SpecialEffect> RoundEffect;
}
I wanted to use an enum for the ammo calibers to make making many new ammo types easier but when i type them down theres an error saying “identifier expected”. I assume the issue is that im trying to have numbers and letters and periods in the enum but id like to store the ammo caliber information this way, what should i do? Id like to still be able to have the ammo calibers be listed with their exact names like “5.56x45” but i dont know if I can name an enum value that.