I'm defining this code:
public enum ModelType {
R4,
W6,
W8,
W9,
X9
}
and I'm using this function in another script:
public void RequestModel(ModelType type, Size size) {
Debug.Log("Requesting " + type.ToString() + " at size " + size.ToString());
}
the output result is:
Requesting 9 at size 4
If I change the code in
Debug.Log("Requesting " + (int)type + " at size " + size.ToString());
I'll get the same result. Does someone know what's going on?
I have to say that the first time I wrote the enum it was like:
public enum ModelType {
EX1,
EX2,
EX3,
EX4,
EX5,
EX6,
EX7,
R4,
W6,
W8,
W9,
X9
}
but I got rid of the EXes because I don't need them anymore.
I also tried to add again the EXes and I got the outputs:
Requesting W8 at size 4 // if I use ToString()
Requesting 9 at size 4 // to print the enum value
that are ok.
I really don't know what to do. I tried to reimport all, restart Unity and Visual Studio but if I delete the EXes nothing will work properly.
Any ideas?
EDIT: sorry guy, I forgot to mention that in the code I'm calling the function as
RequestModel(ModelType.W8, Size._4);
having the wierd result already described.