You can override the size of the enum, if needed:
enum CombatMove : int //implied, 32-bits, max value 2147483647
{
RightMiddleJab = 0, //0
LeftMiddleJab = 1, //1
RightUpperJab = 3, //3
LeftUpperJab, //4
}
And since you can cast them, there is probably no reason to refer to them by name:
CombatMove combatMove = CombatMove.LeftUpperJab;
int combatMoveValue = (int)combatMove;
I don't know exactly what you are trying to index, both types are arbitrary:
using System.Collections.Generic;
Dictionary<CombatMove, AnimationClip> AnimationClipsByEnum;
AnimationClipsByEnum[CombatMove.RightMiddleJab].ClearCurves();
Strings
If you really do have a good reason, you can use the System.Enum class:
string[] CombatMoveNames = System.Enum.GetNames(typeof(CombatMove));
The dictionary for strings:
using System.Collections.Generic;
Dictionary<string, AnimationClip> AnimationClipsByName;
AnimationClipsByName["RightMiddleJab"].ClearCurves();
Parsing a string back into to an enum:
string combatString = "RightMiddleJab";
try
{
CombatMove combatMove =
(CombatMove)System.Enum.Parse(typeof(CombatMove), combatString);
}
catch (System.ArgumentException)
{
Debug.Log("Invalid enum string: " + combatString);
throw;
}