title says all :)
In editor scripts you can save euler angle curves with these names:
Properties saved as `localEulerAngles` (.x, .y, .z) use Quaternion interpolation.
Properties saved as localEulerAnglesBaked (.x, .y, .z) use Euler interpolation.
These properties need to be saved using AnimationUtility.SetEditorCurve
In either case, Quaternion curves are generated from the Euler curves and the Quaternion curves are then stored alongside the Euler curves. When building a player, only the Quaternion curves are included while the Euler curves are stripped. The runtime engine always uses Quaternion curves for animation playback of rotations.
Alternative the Quaternion curves can be saved directly:
Properties saved as localRotation (.x, .y, .z, .w) are combined and stored directly.
This can be done at runtime using AnimationClip.SetCurve. (However, as usual, quaternion values should only be set directly by people who absolutely know what they're doing. The x, y, z, w values of Quaternions have nothing to do with normal rotation angles but rather are based on an extension of complex numbers.)
Note that the combine step when setting Quaternion curves directly may modify the curves. For example, if one of the curves has a key at a certain time, then all of the four curves will get a key at that time, for optimization reasons. The same combine step also applies for position and scale curves, when set using the SetCurve function.