A game about forced loneliness, made by TACStudios
at master 20 lines 704 B view raw
1using UnityEngine; 2 3namespace UnityEditor.Rendering 4{ 5 [CustomPropertyDrawer(typeof(Quaternion))] 6 class QuaternionPropertyDrawer : PropertyDrawer 7 { 8 public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 9 { 10 var euler = property.quaternionValue.eulerAngles; 11 EditorGUI.BeginChangeCheck(); 12 var w = EditorGUIUtility.wideMode; 13 EditorGUIUtility.wideMode = true; 14 euler = EditorGUI.Vector3Field(position, label, euler); 15 EditorGUIUtility.wideMode = w; 16 if (EditorGUI.EndChangeCheck()) 17 property.quaternionValue = Quaternion.Euler(euler); 18 } 19 } 20}