Custom help for editor scripts?

I was wondering if there is a way to customize the help URL for the little book icon in the inspector? Presently I’m using my own help button, but thought it would tidy things up to use the existing UI. Is this possible?

It seems that it’s not possible. The function InspectorTitlebar that is used to display the title bar of an inspector uses this code to display the help icon:

if (Help.HasHelpForObject(targetObj))
{
    Rect position4 = rect2;
    position4.x -= 18f;
    if (GUI.Button(position4, EditorGUI.s_HelpIcon, inspectorTitlebarText))
    {
        Help.ShowHelpForObject(targetObj);
    }
    position2.xMax = position4.xMin - 2f;
}

The functions Help.HasHelpForObject and Help.ShowHelpForObject are mapped to native code so it seems to be “hard-coded”.

I agree that it would be a nice feature to display a custom help page or even better to have a callback for this button :wink:

Use HelpURLAttribute.

[HelpURL("http://example.com/docs/MyComponent.html")]
public class MyComponent
{
   
}

Seems like this isn’t possible, but for now my solution is putting this in my MonoBehaviour:

[MenuItem("CONTEXT/Tile/Help")]
static void Help ()
{
	Application.OpenURL ("http://myhelppage.com");
}

This adds a Help entry to the Context menu for the current script. When you either right click on Script title bar or click on the little drop down menu in next to the help book, this menu comes up.