EditorUtility

来源:互联网 发布:已备案域名如何注销 编辑:程序博客网 时间:2024/06/10 09:50

转载自:http://game.ceeger.com/Script/EditorUtility/EditorUtility.html

Note: This is an editor class. To use it you have to place your script in Assets/Editor inside your project folder. Editor classes are in the UnityEditor namespace so for C# scripts you need to add "using UnityEditor;" at the beginning of the script.
注意:这是一个编辑器类,如果想使用它你需要把它放到工程目录下的Assets/Editor文件夹下。编辑器类在UnityEditor命名空间下。所以当使用C#脚本时,你需要在脚本前面加上 "using UnityEditor"引用。

Class Functions类函数

  • SetDirty
    Marks target object as dirty. // 标记目标物体已改变。
  • IsPersistent
    Determines if an object is stored on disk.
    确定是否一个物体被储存在磁盘上。 
  • DisplayDialog
    Displays a modal dialog. // 显示一个模态对话框。
  • DisplayDialogComplex
    Displays a modal dialog with three buttons. 
    显示一个模态对话框带有三个按钮。 
  • OpenFilePanel
    Displays the "open file" dialog and returns the selected path name.
    显示“open file”对话框,并返回选择的路径名。 
  • SaveFilePanel
    Displays the "save file" dialog and returns the selected path name.
    显示“save file”对话框,并返回选择的路径名。
  • OpenFolderPanel
    Displays the "open folder" dialog and returns the selected path name.
    显示“open folder”对话框,并返回选择的路径名。 
  • SaveFolderPanel
    Displays the "save folder" dialog and returns the selected path name.
    显示“save folder”对话框,并返回选择的路径名。 
  • SaveFilePanelInProject
    Displays the "save file" dialog in the Assets folder of the project and returns the selected path name.
    在项目的资源文件夹,显示“save file”对话框并返回选择的路径名。 
  • InstanceIDToObject
    Translates an instance ID to a reference to an object.
    转换一个实例ID到一个物体的引用。 
  • CompressTexture
    Compress a texture. // 压缩纹理。
  • CloneComponent
    Duplicate a component. // 复制一个组件。
  • CopySerialized
    Copy all settings of a Unity Object.
    拷贝一个Unity物体的所有设置。 
  • CollectDependencies
    Calculates and returns a list of all assets the assets listed in roots depend on.
    计算并返回所有资源的列表,在根依赖的资源列表。 
  • CollectDeepHierarchy
    Calculates and returns a list of all assets the assets listed in roots depend on.
    计算并返回所有资源的列表,在roots依赖的资源列表。 
  • UnloadUnusedAssets
    Unloads assets that are not used. // 卸载不使用的资源。
  • UnloadUnusedAssetsIgnoreM...
    Unloads assets that are not used, including the ones that are referenced only from scripts.
    卸载不使用的资源,其中包括,只能从脚本中引用的。 
  • DisplayPopupMenu
    Displays a popup menu. // 显示一个弹出菜单。
  • FocusProjectWindow
    Brings the project window to the front and focuses it.
    使项目窗口到前面并焦点它。 
  • FormatBytes
    Returns a text for a number of bytes. // 返回字节数的文本。
  • DisplayProgressBar
    Displays or updates a progress bar. // 显示或更新进度条。
  • DisplayCancelableProgressBar
    Displays or updates a progress bar that has a cancel button.
    显示或更新一个进度条,带有一个取消按钮。 
  • ClearProgressBar
    Removes progress bar. // 清除进度条。
  • GetObjectEnabled
    Is the object enabled (0 disabled, 1 enabled, -1 has no enabled button)
    物体是否启用(0 禁用,1 启用,-1 没有启用按钮)。 
  • SetObjectEnabled
    Set the enabled state of the object // 设置物体的启用状态。
  • SetSelectedWireframeHidden
    Set whether the renderer's wireframe will be hidden when the renderer's gameobject is selected
    当渲染器的游戏物体被选择,设置渲染器的显卡是否将要隐藏。 
  • InstantiatePrefab
    Instantiates the given prefab. // 实例化给定的预置。
  • CreateEmptyPrefab
    Creates an empty prefab at given path.
    在给定的路径创建一个空预置。
  • ReplacePrefab
    Replaces the targetPrefab with a copy of the game object hierarchy go.
    替换目标预置,带有游戏物体层级的拷贝。 
  • ReconnectToLastPrefab
    Connects the game object to the prefab that it was last connected to.
     连接游戏物体到最后连接的预置。 
  • ResetToPrefabState
    Resets the properties of the component or game object to the parent prefab state
    重设组件或游戏物体的属性到父预置状态。 
  • ResetGameObjectToPrefabState
    Resets the properties of game object and all attached components to the parent prefab state
    重设游戏物体和所有附加的组件属性到父预置状态。 
  • GetPrefabType
    Given an object, returns whether it's a prefab or an instance of a prefab and what kind of prefab it is.
    给定一个物体,返回是否她的预置或预置的实例和预置的什么种类。 
  • GetPrefabParent
    Returns the GameObject parent of source, or null if it can't be found.
    返回源游戏物体的父级,或没有找到,返回空。 
  • FindPrefabRoot
    Helper function to find the prefab root of an object (used for picking niceness)
    辅助函数来查找一个物体的预置根。 
  • ExtractOggFile
    Saves an AudioClip or MovieTexture to a file.
    保存音频剪辑或影片剪辑到文件。 
  • CreateGameObjectWithHideFlags
    Creates a game object with HideFlags and specified components.
    创建带有标识(HideFlags)的游戏物体并指定组件。

0 0
原创粉丝点击