unity get inspector rotation values code example

Example 1: unity get inspector rotation values

var x = UnityEditor.TransformUtils.GetInspectorRotation(gameObject.transform).x;     var y = UnityEditor.TransformUtils.GetInspectorRotation(gameObject.transform).y;     var z = UnityEditor.TransformUtils.GetInspectorRotation(gameObject.transform).z;     Debug.Log("x: " + x);     Debug.Log("y: " + y);     Debug.Log("z: " + z);

Example 2: unity get inspector rotation values

public static float Clamp0360(float eulerAngles)      {          float result = eulerAngles - Mathf.CeilToInt(eulerAngles / 360f) * 360f;          if (result < 0)          {              result += 360f;          }          return result;      }