public override void OnGUI(Rect position) { InspectorCommentAttribute comment = attribute as InspectorCommentAttribute; // our header is always present Rect posLabel = position; //posLabel.y += 13; //posLabel.x -= 2; //posLabel.height += 13; //EditorGUI.LabelField( posLabel, comment.header, EditorStyles.whiteLargeLabel ); // do we have a message too? if (!string.IsNullOrEmpty(comment.message)) { Color color = GUI.color; Color faded = color; faded.a = 0.6f; Rect posExplain = posLabel; posExplain.y += 15; GUI.color = faded; EditorGUI.LabelField(posExplain, comment.message, EditorStyles.whiteMiniLabel); GUI.color = color; } }
private float GetCommentHeight(InspectorCommentAttribute attribute) { return(fiCommentUtility.GetCommentHeight(attribute.Comment, attribute.Type)); }
protected override float GetElementHeight(GUIContent label, T element, InspectorCommentAttribute attribute, fiGraphMetadata metadata) { return(GetCommentHeight(attribute) + Margin); }
protected override T Edit(Rect region, GUIContent label, T element, InspectorCommentAttribute attribute, fiGraphMetadata metadata) { region.height = GetCommentHeight(attribute); EditorGUI.HelpBox(region, attribute.Comment, MapCommentType(attribute.Type)); return(element); }