Ejemplo n.º 1
0
        public override void OnGUI(Rect rect)
        {
            InfoBoxAttribute infoBoxAttribute = (InfoBoxAttribute)attribute;

            float indentLength = DDFEditorGUI.GetIndentLength(rect);
            Rect  infoBoxRect  = new Rect(
                rect.x + indentLength,
                rect.y,
                rect.width - indentLength,
                GetHelpBoxHeight() - 2.0f);

            DrawInfoBox(infoBoxRect, infoBoxAttribute.Text, infoBoxAttribute.Type);
        }
Ejemplo n.º 2
0
        private void DrawInfoBox(Rect rect, string infoText, InfoBoxType infoBoxType)
        {
            MessageType messageType = MessageType.None;

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

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

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

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