ArgumentException: enumType is not an Enum type.

ArgumentException: enumType is not an Enum type.
Parameter name: enumType

Hey people, this is the error I am getting in C# Unity thanks to this type of code;

	_primaryAttribute = new Attribute[Enum.GetValues(typeof(Attribute)).Length];
	_vital = new Vital[Enum.GetValues(typeof(Vital)).Length];
	_skill = new Skill[Enum.GetValues(typeof(Skill)).Length];

Now what I’m doing is getting the length of the amount of Enums that are here, but when I specify the Enums they look like this. for example.

       public enum AttributeName
		{
			Strengh,
			Endurance,
			Speed
		}

What is the problem that I have caused here? Do I need to cast? Because I can’t think of a other solutions from looking around stackover flow and other forums.

Cheers in advance,

It looks like you’ve got a typo. You’ve got typeof(Attribute) but I think you really mean typeof(AttributeName). Attribute is a .NET class which is not an enum.