- Home /
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:
Right now, when I click that icon, I'm taken to the generic MonoBehavior docs.
Does anyone know how I can change where this icon links to?
Thanks!
BTW, this is a dupe of http://answers.unity3d.com/questions/170702/custom-help-for-editor-scripts.html.
Just a poke: Could you please mark Thrawn75's answer as the correct answer? (if you also believe so, 7 years later?) ;)
Answer by Kronnect · Aug 31, 2016 at 03:21 PM
Use [HelpUrl] annotation on your script class.
Indeed it's the correct answer. Voting and commenting to increase its relevance.
Answer by yoyo · Jan 02, 2013 at 10:53 PM
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");
Answer by makaka-org · Feb 04, 2018 at 04:07 PM
☄ [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: https://makaka.org/unity-assets/asset-store-tools
Video: https://www.youtube.com/watch?v=jFOt0B2AinY
Your answer
Follow this Question
Related Questions
Components added programatically - visibility in inspector 1 Answer
How can I hide a MonoBehaviour from the Inspector? (or make it extremely thin or compact) 1 Answer
ECS, IComponentData wont show in inspector 1 Answer
Simple text in inspector components? 2 Answers
TextMeshPro Not updating Text with Rich Tags Immediately 1 Answer