public void DrawDefaultPropertyAndHelpBox(Rect rect, SerializedProperty property, string message, MessageType messageType) { float indentLength = ExternalCustomEditorGUI.GetIndentLength(rect); Rect helpBoxRect = new Rect( rect.x + indentLength, rect.y, rect.width - indentLength, GetHelpBoxHeight()); ExternalCustomEditorGUI.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); }
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; } ExternalCustomEditorGUI.HelpBox(rect, infoText, messageType); }