暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

QuaternionDrawer.cs 506B

123456789101112131415161718
  1. using UnityEditor;
  2. namespace Unity.Mathematics.Editor
  3. {
  4. [CustomPropertyDrawer(typeof(quaternion))]
  5. class QuaternionDrawer : PostNormalizedVectorDrawer
  6. {
  7. protected override SerializedProperty GetVectorProperty(SerializedProperty property)
  8. {
  9. return property.FindPropertyRelative("value");
  10. }
  11. protected override double4 Normalize(double4 value)
  12. {
  13. return math.normalizesafe(new quaternion((float4)value)).value;
  14. }
  15. }
  16. }