x


Before updating to Windows 10 you may need to return your Pro license. More information here

Ability to define custom help menu (PDF)

When creating an editor extension is it possible to define a custom menu item under "Help" that displays a PDF asset?

more ▼

asked May 01, 2012 at 03:56 AM

avatar image

numberkruncher
5.1k 147 166 163

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first
 public static class MyHelpMenu {

     [MenuItem("Help/My User Guide")]
     public static void OnHelp_MyUserGuide() {
         EditorUtility.OpenWithDefaultApp("Assets/My Asset/Support/User Guide.pdf");
     }

     [MenuItem("Help/My API Documentation")]
     public static void OnHelp_MyAPIDocumentation() {
         // Note: Open CHM file on Windows, otherwise use online guide
         if (Application.platform == RuntimePlatform.WindowsEditor)
             EditorUtility.OpenWithDefaultApp("Assets/My Asset/Support/API Documentation.chm");
         else
             EditorUtility.OpenWithDefaultApp("http://example.com/product/api");
     }

 }
more ▼

answered May 01, 2012 at 11:29 PM

avatar image

numberkruncher
5.1k 147 166 163

(comments are locked)
10|3000 characters needed characters left

I would assume it's as easy as

 [MenuItem ("Help/Show PDF")]
 static void ShowPDF()
 {
     System.Diagnostics.Process.Start("yourpdf.pdf");
 }
more ▼

answered May 01, 2012 at 04:18 AM

avatar image

-hiTo-
495 2 7 6

Thank you for your response. I tried to do this but I could not get this to work properly on Mac. (Probably something I was doing wrong) But I did accidentally stumble upon the solution (thanks to IntelliSense) when I was writing another piece of code (see below).

May 01, 2012 at 11:22 PM numberkruncher
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3406
x63
x37

asked: May 01, 2012 at 03:56 AM

Seen: 904 times

Last Updated: May 01, 2012 at 11:29 PM