UnityEditor.MaterialEditor.HelpBoxWithButton C# (CSharp) Method

HelpBoxWithButton() public method

public HelpBoxWithButton ( GUIContent messageContent, GUIContent buttonContent ) : bool
messageContent UnityEngine.GUIContent
buttonContent UnityEngine.GUIContent
return bool
        public bool HelpBoxWithButton(GUIContent messageContent, GUIContent buttonContent)
        {
            Rect position = GUILayoutUtility.GetRect(messageContent, EditorStyles.helpBox);
            GUILayoutUtility.GetRect((float) 1f, (float) 25f);
            position.height += 25f;
            GUI.Label(position, messageContent, EditorStyles.helpBox);
            Rect rect2 = new Rect((position.xMax - 60f) - 4f, (position.yMax - 20f) - 4f, 60f, 20f);
            return GUI.Button(rect2, buttonContent);
        }

Usage Example

示例#1
0
 void DoNormalArea()
 {
     m_MaterialEditor.TexturePropertySingleLine(Styles.normalMapText, bumpMap, bumpMap.textureValue != null ? bumpScale : null);
     if (bumpScale.floatValue != 1 && UnityEditorInternal.InternalEditorUtility.IsMobilePlatform(EditorUserBuildSettings.activeBuildTarget))
     {
         if (m_MaterialEditor.HelpBoxWithButton(
                 new GUIContent("Bump scale is not supported on mobile platforms"),
                 new GUIContent("Fix Now")))
         {
             bumpScale.floatValue = 1;
         }
     }
 }
All Usage Examples Of UnityEditor.MaterialEditor::HelpBoxWithButton
MaterialEditor