C#: Type or namespace name could not be found

I’m trying to learn C# programming on unity with help of a 200-part tutorial on youtube. So far all the errors I’ve encountered I managed to fix myself, them having mostly been typos, but now I’ve run into one I just can’t figure out myself, and the last comment to the specific video on youtube was 1 month ago so I won’t expect help from there.

So I have 3 errors, all around this specific line of code:

_primaryAttribute = new Attribute[Enum.GetValues(typeof(AttributeName)).Length];

The errors are:

Assets/Tutorial scripts/CharacterClass/BaseCharacter.cs(20,73): error CS0246: The type or namespace name `AttributeName’ could not be found. Are you missing a using directive or an assembly reference?

Assets/Tutorial scripts/CharacterClass/BaseCharacter.cs(20,56): error CS1502: The best overloaded method match for `System.Enum.GetValues(System.Type)’ has some invalid arguments

Assets/Tutorial scripts/CharacterClass/BaseCharacter.cs(20,56): error CS1503: Argument #1' cannot convert object’ expression to type `System.Type’

As I’m really not good at this I couldn’t tell for sure but judging from those descriptions I would guess the 2 latter problems get fixed if the first one does. Still, I’ve quadruple-checked that code line and that whole script too, and I can’t find any typos. I know that error can also range from the class having been named something else, but I checked that more than once as well and the names are identical. I tried renaming both the class and this variable something else too, but without success. Plus, I’m using the latest version of unity.

So to cut it short, I’m out of ideas and my second last hope lies in this forum (the last one would be to get a good night’s sleep and look at the script in a different light). There’s something that makes this even stranger: I have 2 precisely similar code lines about other classes below the one shown above, and yet those don’t bring up any errors.

Here’s the relevant part of the script:

using UnityEngine;
using System.Collections;
using System;							//to access enum class

public class BaseCharacter : MonoBehaviour {
	private string _name;
	private int _level;
	private uint _freeExp;
	
	private Attribute[] _primaryAttribute;
	private Vital[] _vital;
	private Skill[] _skill;
	
	public void Awake()
	{
		_name = string.Empty;
		_level = 0;
		_freeExp = 0;
		
		_primaryAttribute = new Attribute[Enum.GetValues(typeof(AttributeName)).Length];
		_vital = new Vital[Enum.GetValues(typeof(VitalName)).Length];
		_skill = new Skill[Enum.GetValues(typeof(SkillName)).Length];
	}

And for comparison, also the scripts of those classes vital, attribute and skill, which as mentioned before are identical to my eye and yet only vital and skill work (I wont post the lists related to the to save space):

public class Attribute : ModifiedStat {
	
	public Attribute()
	{
		ExpToLevel = 50;
		LevelModifier = 1.05f;
	}
	
	public enum AttributeName
public class Vital : ModifiedStat {
	private int _curValue;
	
	public Vital()
	{
		_curValue = 0;
		ExpToLevel = 50;
		LevelModifier = 1.1f;
	}
	
	public int CurValue
	{
		get
		{
			if (_curValue > AdjustedBaseValue)
				_curValue = AdjustedBaseValue;
			
			return _curValue;
		}
		set
		{
			_curValue = value;
		}
	}
}

public enum VitalName
public class Skill : ModifiedStat {
	private bool _known;
	
	public Skill()
	{
		_known = false;
		ExpToLevel = 25;
		LevelModifier = 1.5f;
	}
	
	public bool Known
	{
		get{ return _known; }
		set{ _known = value; }
	}
}

public enum SkillName

On a last note, before anyone asks, all the scripts are definitely located in the same subfolder.

Try:

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

That actually worked… thanks.