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
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
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Linux] Touch freezes in Player when any mouse button is clicked
- UnityEngine.Rendering.Volume.OnEnable() is called twice before OnDisable() creating multiple copies of the same volume when a volume is enabled right after Domain Reload when entering Play Mode
- Hinge Joint transforms are reset when toggling the "useMotor" property
- Motion Vector texture reports incorrect Mesh data when Mesh is coming from off-screen
- [macOS] Display flickers with bright colors when built Player uses 2 or more Displays
Add comment