I’ve been running into a small problem that I can’t figure out.
In one script I declare an class that has a public enum in it.
class a
{
public enum testValues { TEST1, TEST2 };
}
In another script/class I have a member variable of the same enum type
class b
{
a.testValues TestValue;
}
Now, when I try to do a comparison such as
if ( a.testValues.TEST1 == TestValue )
{
...
}
I keep getting an error message that tells me
error CS0266: Cannot implicitly convert type a.testValues' to int’. An explicit conversion exists (are you missing a cast?)
Does anyone know what’s going on here? They are both of the same type. Shouldn’t they compare just fine? I don’t really want to cast here unless it is absolutely necessary.