public void DrawDefaultPropertyAndHelpBox(Rect rect, SerializedProperty property, string message, MessageType messageType)
        {
            float indentLength = NaughtyEditorGUI.GetIndentLength(rect);
            Rect  helpBoxRect  = new Rect(
                rect.x + indentLength,
                rect.y,
                rect.width - indentLength,
                GetHelpBoxHeight());

            NaughtyEditorGUI.HelpBox(helpBoxRect, message, MessageType.Warning, context: property.serializedObject.targetObject);

            Rect propertyRect = new Rect(
                rect.x,
                rect.y + GetHelpBoxHeight(),
                rect.width,
                GetPropertyHeight(property));

            EditorGUI.PropertyField(propertyRect, property, true);
        }
Пример #2
0
        private void DrawInfoBox(Rect rect, string infoText, EInfoBoxType infoBoxType)
        {
            MessageType messageType = MessageType.None;

            switch (infoBoxType)
            {
            case EInfoBoxType.Normal:
                messageType = MessageType.Info;
                break;

            case EInfoBoxType.Warning:
                messageType = MessageType.Warning;
                break;

            case EInfoBoxType.Error:
                messageType = MessageType.Error;
                break;
            }

            NaughtyEditorGUI.HelpBox(rect, infoText, messageType);
        }