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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
Add comment