EditorApplication 编辑器应用程序
Main Application class.
主应用程序类。
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 Variables类变量
- currentSceneThe path of the scene that the user has currently open (Read Only)
用户当前打开场景的路径(只读) - isPlayingIs editor currently in play mode?
编辑器当前是否在播放模式? - isPlayingOrWillChangePlaymodeIs editor either currently in play mode, or about to switch to it? (Read Only)
当前编辑器是否在播放模式或者即将切换到播放模式(只读)。 - isPausedIs editor currently paused?
当前编辑器是否暂停? - isCompilingIs editor currently compiling scripts? (Read Only)
当前编辑器是否在编译脚本(只读)? - applicationContentsPathPath to the Unity editor contents folder (Read Only)
到Unity编辑器内容文件夹的路径(只读)。 - applicationPathReturns the path to the Unity editor application (Read Only)
返回Unity编辑器应用程序的路径(只读)。 - projectWindowItemOnGUIDelegate for OnGUI events for every visible list item in the ProjectWindow.
委托用于OnGUI事件在项目窗口每个可见列表项。 - hierarchyWindowItemOnGUIDelegate for OnGUI events for every visible list item in the HierarchyWindow.
委托用于OnGUI事件在层级窗口每个可见列表项。 - updateDelegate for generic updates.
通用更新的委托。 - modifierKeysChangedDelegate for changed keyboard modifier keys.
用于改变的键盘修改键(组合键)的委托。 - playmodeStateChangedDelegate for play mode state changes.
对播放模式状态改变的委托。 - timeSinceStartupThe time since the editor was started (Read Only)
从编辑器打开至今的时间(只读)。
Class Functions类函数
- NewSceneCreate a new scene // 创建一个新的场景。
- OpenSceneOpens the scene at path. // 打开指定路径下的场景。
- OpenSceneAdditiveOpens the scene at path additively.
打开在附加路径的场景。 - SaveSceneSave the scene at path. // 保存场景到指定路径。
- SaveCurrentSceneIfUserWantsToAsk the user if he wants to save the open scene.
询问用户是否要保存当前场景。 - OpenProjectOpen another project. // 打开另外一个工程。
- SaveAssetsSaves all serializable assets that have not yet been written to disk (eg. Materials)
保存所有未写入磁盘可序列化的资源(例如,材质)。 - StepPerform a single frame step.
执行单帧。就是一帧一帧的执行。 - LockReloadAssembliesPrevents loading of assemblies when it is inconvenient.
当编辑器不便时,阻止加载程序集。 - ExecuteMenuItemInvokes the menu item in the specified path.
调用指定路径的菜单项。 - UnlockReloadAssembliesMust be called after LockReloadAssemblies, to reenable loading of assemblies.
必须在LockReloadAssemblies之后调用,用来重新激活加载程序集。 - ExitExit the Unity editor application.
退出Unity编辑器程序。 - RepaintProjectWindowCan be used to ensure repaint of the ProjectWindow.
可以用来确保项目窗口重绘。 - RepaintHierarchyWindowCan be used to ensure repaint of the HierarchyWindow.
可用来确保层级窗口重绘。 - BeepPlays system beep sound. // 播放系统鸣叫。
Delegates委托
- ProjectWindowItemCallbackDelegate to be called for every visible list item in the ProjectWindow on every OnGUI event.
委托调用用于在ProjectWindow每个OnGUI事件上每个可见列表项。 - HierarchyWindowItemCallbackDelegate to be called for every visible list item in the HierarchyWindow on every OnGUI event.
委托调用用于在HierarchyWindow每个OnGUI事件上每个可见列表项。 - CallbackFunctionDelegate to be called from EditorApplication callbacks.
委托需从EditorApplication回调调用。