Search Issue Tracker

By Design

Votes

0

Found in

5.4.0b10

Issue ID

781646

Regression

No

Enum field does not retain value but rather position of the value in the list

Scripting

-

Steps to reproduce:
1. Create new project
2. Create empty game object and add empty script to it
3. Paste this into the said script:
public enum BuggyEnums {
One,
Two,
//Five,
Three,
Four
}

public BuggyEnums bug;
(Note the commented line)
4. Go to the inspector of the object and select enum value "Three"
5. Open the script again and uncomment line "Five", save the script
6. Open up inspector again for the said object and notice that value is now "Five" instead of "Three"

Actual result: Enum retains its value based on the position of the entry in the list
Expected result: Enum keeps the value it is assigned, regardless of its position

Tested and reproduced on:
Windows 10
Unity 5.2.4p1, 5.3.4p2, 5.4.0b13

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.