This issue is purely related to the Editor Mode, not Play Mode. The goal I am trying to reach is simply reading and saving the Euler angles of an object for use later on.
Prior to Unity 5.4, when you wanted to get the values that were entered in the Transform inspector for rotation, you would call gameObject.transform.localEulerAngles. Here’s some screenshots from Unity 5.3.1f1, using a Cube with rotation set to X: 400, Y: 0, Z: 0:
(Showing all the different rotation fields just to be thorough, but really just focus on the 3rd log for localEulerAngles)
So rotation was set to X: 400, Y: 0, Z: 0, and I got back (400.0, 0.0, 0.0). Great!
But now in Unity 5.4 onward this is what I get, using the same values:
So now I’m getting an X value of 40 instead of 400. I know both values result in the same orientation of the object, I don’t want the resulting orientation. I want to record a history of the object’s rotation values so that I can interpolate between them, and in this case, rotating an object from X=0 to X=400 is not the same as rotating an object from X=0 to X=40.
It’s really frustrating because the values we need are sitting right there in the inspector, and I’m working on scripts for use in Editor Mode, but I can’t seem to find a new way to get those values.