how to convert enum to int c# code example
Example 1: c# enum to int
Just cast the enum, e.g.
int something = (int) WeaponType.BFG;
Example 2: convert int to enum c#
YourEnum foo = (YourEnum)yourInt;
Just cast the enum, e.g.
int something = (int) WeaponType.BFG;
YourEnum foo = (YourEnum)yourInt;