Beispiel #1
0
        private static void DrawEuler(Rect position, SerializedProperty property, EulerAttribute attribute)
        {
            if (property.propertyType != SerializedPropertyType.Quaternion)
            {
                position = MightyGUIUtilities.DrawPropertyField(position, property);
                MightyGUIUtilities.DrawHelpBox(position, $"{property.name} should be of type Quaternion");
                return;
            }

            if (attribute.Options.Contains(FieldOption.HideLabel))
            {
                MightyGUIUtilities.DrawRotationEuler(position, GUIContent.none, property);
            }
            else
            {
                MightyGUIUtilities.DrawRotationEuler(position, property);
            }
        }
Beispiel #2
0
        private static void DrawEuler(SerializedProperty property, EulerAttribute attribute, GUIContent label = null)
        {
            if (property.propertyType != SerializedPropertyType.Quaternion)
            {
                MightyGUIUtilities.DrawPropertyField(property, label);
                MightyGUIUtilities.DrawHelpBox($"{property.name} should be of type Quaternion");
                return;
            }

            if (attribute.Options.Contains(FieldOption.HideLabel))
            {
                MightyGUIUtilities.DrawRotationEuler(GUIContent.none, property);
            }
            else
            {
                MightyGUIUtilities.DrawRotationEuler(label ?? EditorGUIUtility.TrTextContent(property.displayName), property);
            }
        }