Ejemplo n.º 1
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            AffirmStyles();

            label = EditorGUI.BeginProperty(position, label, property);

            Rect pathRect = position;

            pathRect.height = EditorGUIUtility.singleLineHeight;

            pathRect = EditorGUI.PrefixLabel(pathRect, label);
            EditorGUI.PropertyField(pathRect, property, GUIContent.none);

            using (new EditorGUI.IndentLevelScope())
            {
                GUIContent content = StatusContent(property);

                Rect infoRect = EditorGUI.IndentedRect(position);
                infoRect.y      = pathRect.yMax;
                infoRect.height = StatusSize(content).y;

                infoRect = EditorUtils.DrawHelpButton(infoRect, () => new SimpleHelp(HelpText, 400));

                GUI.Label(infoRect, content, RichTextStyle);
            }

            EditorGUI.EndProperty();
        }
Ejemplo n.º 2
0
        private static void DrawMismatchUI(Rect rect, float repairButtonX, float repairButtonWidth,
                                           MismatchInfo mismatch, SerializedProperty property)
        {
            rect = EditorUtils.DrawHelpButton(rect, () => new SimpleHelp(mismatch.HelpText, 400));

            Rect repairRect = new Rect(repairButtonX, rect.y, repairButtonWidth, GetBaseHeight());

            if (GUI.Button(repairRect, new GUIContent(RepairIcon, mismatch.RepairTooltip), buttonStyle))
            {
                mismatch.RepairAction(property);
            }

            Rect labelRect = rect;

            labelRect.xMax = repairRect.xMin;

            GUI.Label(labelRect, new GUIContent(mismatch.Message, WarningIcon));
        }