Help.ShowHelpForObject 为物体显示帮助

static function ShowHelpForObject (obj : Object) : bool

Description描述

Show help page for this object.

为这个对象显示帮助页面

参见: Help.HasHelpForObject.

Help.ShowHelpForObject 为物体显示帮助

Editor Window that lets you load docs for any Selected GameObject.

// EditorScript that quickly searchs for a help page

// of the selected Object.

//编辑器脚本快速搜索选择物体的帮助页面

// If there is no page found on the Manual it opens the Unity forum.

//如果手册中没有发现页面,将打开Unity论坛

import UnityEditor;



class QuickHelper extends EditorWindow {



	var source : Object;



	@MenuItem("Example/QuickHelper _h")

	static function Init() {

		var window : QuickHelper = EditorWindow.GetWindowWithRect(QuickHelper, Rect(0,0,165,100));

		window.Show();

	}



	function OnGUI() {

		EditorGUILayout.BeginHorizontal();

		source = EditorGUILayout.ObjectField(source, Object);

		EditorGUILayout.EndHorizontal();



		if(GUILayout.Button("Search!")) {

			if(source == null) {

			this.ShowNotification(GUIContent("No object selected for searching"));

			} else {

				if(Help.HasHelpForObject(source))

					Help.ShowHelpForObject(source);

				else

					Help.BrowseURL("http://forum.unity3d.com/search.php");

			}

		}

	}

}
Page last updated: 2011-6-15