EditorGUI 的各种辅助程序。
currentViewWidth | The width of the GUI area for the current EditorWindow or other view. This Property should only be accessed within an OnGUI call. |
editingTextField | 文本字段是否正在编辑文本? |
fieldWidth | 为 Editor GUI 控件字段保留的最小宽度(以像素为单位)。 |
hierarchyMode | Editor GUI 是否采用层次结构模式? |
isProSkin | 用户当前是否正在使用 pro 皮肤?(只读) |
labelWidth | 为 Editor GUI 控件标签保留的宽度(以像素为单位)。 |
pixelsPerPoint | 当前视图的 GUI 点相对于屏幕像素的比例。该值是每个界面空间点的屏幕像素数。例如,Retina 显示屏上的 2.0。请注意,如果视图位于具有不同 UI 比例的显示器上,该值可能会因视图而异。 |
singleLineHeight | 获取用于单个 Editor 控件(如单行 EditorGUI.TextField 或 EditorGUI.Popup)的高度。 |
standardVerticalSpacing | 获取默认用于控件之间垂直间距的高度。 |
systemCopyBuffer | 系统复制缓冲区。 |
textFieldHasSelection | 如果文本字段当前已获得焦点并且其中的文本被选中,则为 true。 |
whiteTexture | 获取白色纹理。 |
wideMode | Editor GUI 当前是否处于宽模式? |
AddCursorRect | 向控件添加自定义鼠标指针。 |
CommandEvent | 创建可以发送到另一个窗口的事件。 |
DrawColorSwatch | 绘制颜色样本。 |
DrawCurveSwatch | 绘制曲线样本。 |
DrawRegionSwatch | 绘制在两条 SerializedProperty 曲线之间具有填充区域的样本。 |
FindTexture | 从源文件名中获取纹理。 |
GetBuiltinSkin | 获取其中一个内置 GUI 皮肤,可以是按参数选择的游戏视图、检视面板或场景视图皮肤。 |
GetFlowLayoutedRects | 在给定区域中按从左到右、从上到下的方式布置字符串项的列表。 |
GetIconForObject | Gets the custom icon associated with an object. Only GameObjects and MonoScripts have associated custom icons. |
GetIconSize | 获取已使用 SetIconSize 设置的大小。 |
GetMainWindowPosition | Returns position of Unity Editor's main window. |
GetObjectPickerControlID | 当前显示的 Object Picker 的 controlID。 |
GetObjectPickerObject | Object Picker 中当前选中的对象。 |
HasObjectThumbnail | 给定的类是否具有针对每个对象的缩略图? |
IconContent | 从具有给定名称的 Unity 内置资源中获取 GUIContent。 |
IsDisplayReferencedByCameras | 检查是否有任何已启用的摄像机可以渲染到特定显示屏。 |
Load | 加载内置资源。 |
LoadRequired | 加载所需的内置资源。 |
LookLikeControls | 使所有 EditorGUI 看起来像常规控件。 |
ObjectContent | 返回具有某个 Object 的名称和图标的 GUIContent 对象。 |
PingObject | 在场景中对对象执行 Ping 操作,就像在检视面板中单击它一样。 |
PixelsToPoints | 从像素空间转换为点空间。 |
PointsToPixels | 从点空间转换为像素空间。 |
QueueGameViewInputEvent | 将输入事件发送到游戏中。 |
SetIconForObject | Sets a custom icon to associate with a GameObject or MonoScript. The custom icon is displayed in the Scene view and the Inspector. |
SetIconSize | 将渲染为 GUIContent 一部分的图标设置为以特定大小渲染。 |
SetMainWindowPosition | Sets position of Unity Editor's main window. |
ShowObjectPicker | 通过代码显示 Object Picker。 |
hasModalWindow | 一个全局属性;如果正在显示 ModalWindow,则为 true,否则为 false。 |
hotControl | 当前热控件的 controlID。 |
keyboardControl | 具有键盘焦点的控件的 controlID。 |
systemCopyBuffer | 获取系统剪贴板的访问权限。 |
AlignRectToDevice | 将本地空间矩形与像素网格对齐。 |
ExitGUI | 通过抛出 ExitGUIException 来将 GUI 置于这样一种状态:阻止所有后续即时模式 GUI 函数计算 GUI 循环的其余部分。 |
GetControlID | 为控件获取一个唯一的 ID。 |
GetStateObject | 从 controlID 获取状态对象。 |
GUIToScreenPoint | 将一个点从 GUI 位置转换为屏幕空间位置。 |
GUIToScreenRect | 将矩形从 GUI 位置转换到屏幕空间。 |
QueryStateObject | 从 controlID 获取一个现有的状态对象。 |
RotateAroundPivot | 让 GUI 围绕一个点旋转的 Helper 函数。 |
ScaleAroundPivot | 让 GUI 围绕一个点缩放的 Helper 函数。 |
ScreenToGUIPoint | 将一个点从屏幕空间位置转换为 GUI 位置。 |
ScreenToGUIRect | 将矩形从屏幕空间转换到 GUI 位置。 |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.