How can I link to my docs in a Custom Inspector panel?

We’ve created a Custom Inspector panel for a Unity component we are releasing, and I’d love to be able to link directly to our documentation when a user clicks on the documentation icon in the inspector panel:

6321-custom-inspector-docs.png

Right now, when I click that icon, I’m taken to the generic [MonoBehavior](file://localhost/Applications/Unity/Unity.app/Contents/Documentation/Documentation/ScriptReference/MonoBehaviour.html) docs.

Does anyone know how I can change where this icon links to?

Thanks!

Use [HelpUrl] annotation on your script class.

Unity’s Editor classes uses the Help class to launch the documentation. Basically if there is help available for the “target” of your editor, then it will be shown. Unfortunately the documentation for HasHelpForObject and ShowHelpForObject doesn’t suggest that it’s possible to add your own objects or object types.

You could add your own help button that uses Help.BrowseURL to launch the documentation.

And you could probably use GUI.Button with a rectangle that puts your button on top of the standard one. Here is the code used for the standard button:

GUI.Button(new Rect(r.width - 36f, r.y + 5f, 14f, 14f), EditorGUI.s_HelpIcon, EditorStyles.inspectorTitlebarText)

Where r is the rectangle defining the editor header region and the help icon is initialized with:

EditorGUI.s_HelpIcon = EditorGUIUtility.IconContent("_Help");

:comet: [HelpUrl] & Flexible Image Header in Publisher Component

Publisher Component is a decoration for your script inspector.

Now your product will always look cool.

Download: https://makaka.org/o/publisher-window

Documentation: Unity Asset Store Publisher 2023 — Create, Sell Unity Assets

Video: Unity Publisher Component 🎨 Custom Editor — Unity Asset Store Publisher - YouTube

alt text