diff --git a/Source/Editor/CustomEditors/Editors/QuaternionEditor.cs b/Source/Editor/CustomEditors/Editors/QuaternionEditor.cs index 5d4290113..f80c81e27 100644 --- a/Source/Editor/CustomEditors/Editors/QuaternionEditor.cs +++ b/Source/Editor/CustomEditors/Editors/QuaternionEditor.cs @@ -12,9 +12,9 @@ namespace FlaxEditor.CustomEditors.Editors [CustomEditor(typeof(Quaternion)), DefaultEditor] public class QuaternionEditor : CustomEditor { - private Vector3 _cachedAngles = Vector3.Zero; + private Vector3 _cachedAngles = Vector3.Zero; private object _cachedToken; - + /// /// The X component element /// @@ -63,7 +63,7 @@ namespace FlaxEditor.CustomEditors.Editors var isSliding = XElement.IsSliding || YElement.IsSliding || ZElement.IsSliding; var token = isSliding ? this : null; - var useCachedAngles = isSliding && token == _cachedToken; + var useCachedAngles = isSliding && token == _cachedToken; float x = (useCachedAngles && !XElement.IsSliding) ? _cachedAngles.X : XElement.FloatValue.Value; float y = (useCachedAngles && !YElement.IsSliding) ? _cachedAngles.Y : YElement.FloatValue.Value; @@ -79,11 +79,11 @@ namespace FlaxEditor.CustomEditors.Editors } _cachedToken = token; - + Quaternion.Euler(x, y, z, out Quaternion value); SetValue(value, token); } - + /// protected override void ClearToken() {