/// <summary>
        /// Draws button linking to documentation.
        /// </summary>
        /// <param name="serviceType"></param>
        /// <returns></returns>
        private bool DrawDocLink(Type serviceType)
        {
            DocLinkAttribute docLink = serviceType.GetCustomAttribute <DocLinkAttribute>();

            if (docLink != null)
            {
                GUIContent buttonContent = new GUIContent();
                buttonContent.image   = EditorGUIUtility.IconContent("_Help").image;
                buttonContent.text    = " Documentation";
                buttonContent.tooltip = docLink.URL;

                GUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();

                if (GUILayout.Button(buttonContent, GUILayout.MaxWidth(docLinkWidth)))
                {
                    Application.OpenURL(docLink.URL);
                }

                GUILayout.FlexibleSpace();
                GUILayout.EndHorizontal();
                EditorGUILayout.Space();
                return(true);
            }
            return(false);
        }
Beispiel #2
0
        /// <summary>
        /// Draws a documentation link for the service.
        /// </summary>
        protected void RenderDocLink(Object profileObject)
        {
            if (profileObject == null)
            {   // Can't proceed if profile is null.
                return;
            }

            DocLinkAttribute docLink = profileObject.GetType().GetCustomAttribute <DocLinkAttribute>();

            if (docLink != null)
            {
                InspectorUIUtility.RenderDocLinkButton(docLink.URL);
            }
        }
Beispiel #3
0
        /// <summary>
        /// Draws button linking to documentation.
        /// </summary>
        /// <param name="serviceType">type of service to target</param>
        /// <returns>true if doc link is found, false otherwise</returns>
        private bool DrawDocLink(Type serviceType)
        {
            DocLinkAttribute docLink = serviceType.GetCustomAttribute <DocLinkAttribute>();

            if (docLink != null)
            {
                GUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();

                InspectorUIUtility.RenderDocLinkButton(docLink.URL);

                GUILayout.FlexibleSpace();
                GUILayout.EndHorizontal();
                EditorGUILayout.Space();
                return(true);
            }
            return(false);
        }