EditorUtility
- ClearProgressBar
- CloneComponent
- CollectDeepHierarchy
- CollectDependencies
- CompressTexture
- CopySerialized
- CreateEmptyPrefab
- CreateGameObjectWithHideFlags
- DisplayCancelableProgressBar
- DisplayDialogComplex
- DisplayDialog
- DisplayPopupMenu
- DisplayProgressBar
- ExtractOggFile
- FindPrefabRoot
- FocusProjectWindow
- FormatBytes
- GetObjectEnabled
- GetPrefabParent
- GetPrefabType
- InstanceIDToObject
- InstantiatePrefab
- IsPersistent
- OpenFilePanel
- OpenFolderPanel
- ReconnectToLastPrefab
- ReplacePrefab
- ResetGameObjectToPrefabState
- ResetToPrefabState
- SaveFilePanelInProject
- SaveFilePanel
- SaveFolderPanel
- SetDirty
- SetObjectEnabled
- SetSelectedWireframeHidden
- UnloadUnusedAssetsIgnoreM...
- UnloadUnusedAssets
EditorUtility.DisplayPopupMenu 显示弹出菜单
static function DisplayPopupMenu (position : Rect, menuItemPath : string, command : MenuCommand) : void
Description描述
Displays a popup menu.
显示一个弹出菜单。
Menu is shown at position pos, generated from a submenu specified by menuItemPath using a MenuCommand as menu context.
菜单显示在position位置,从menuItemPath指定的子菜单生成,使用MenuCommand作为菜单上下文。
// Shows the Assets menu when you right click on the contextRect Rectangle.
//当右击contextRect矩形,显示资源菜单
class EditorUtilityDisplayPopupMenu extends EditorWindow {
function OnGUI () {
var evt = Event.current;
var contextRect = Rect(10,10,100,100);
if(evt.type == EventType.ContextClick) {
var mousePos = evt.mousePosition;
if (contextRect.Contains (mousePos)) {
EditorUtility.DisplayPopupMenu (Rect (mousePos.x,mousePos.y,0,0), "Assets/", null);
evt.Use();
}
}
}
}
最后修改:2011年7月15日 Friday 19:23