用于在 Scene View 中编辑包围体积的复合手柄基类。
此类允许您显示最多包含六个控制手柄的形状,以便同时编辑包围体积的大小和中心。拖动任何一个控制手柄都将沿控制手柄的轴扩展体积。在拖动控制手柄时,从此类继承的所有类也会获得以下修改键:\ \ • **Alt**:在单击控制手柄时将体积的 center 固定到其位置,然后沿控制手柄的移动轴在两个方向上增加大小。\ • **Shift**:沿着所有启用的 axes 均匀缩放体积,使之与单击控制手柄时的大小成比例。\ \ 此类的 DrawHandle 方法渲染的手柄受 Handles 类(比如 Handles.matrix 和 Handles.color)的全局状态影响。\ \ 另请参阅:Editor.OnSceneGUI、Handles.SetCamera。
axes | 指定哪些轴应显示控制手柄的标志。 |
center | 返回或指定手柄包围体积的中心。 |
handleColor | 返回或指定控制手柄的颜色。 |
midpointHandleDrawFunction | 显示控制手柄时使用的可选 CapFunction。如果未指定值,则默认为 Handles.DotHandleCap。 |
midpointHandleSizeFunction | 用于指定中点控制手柄应该多大的 SizeFunction。 |
wireframeColor | 返回或指定线框形状的颜色。 |
PrimitiveBoundsHandle | 创建 PrimitiveBoundsHandle 类的新实例。 |
DrawHandle | 使用实例的当前配置在当前手柄摄像机中显示此实例的函数。 |
SetColor | 将 handleColor 和 wireframeColor 设置为相同的值。 |
DrawWireframe | 绘制此实例的线框形状。子类必须实现此方法。 |
GetSize | 获取此实例包围体积的当前大小。 |
IsAxisEnabled | 获取指示是否为当前实例启用了指定轴的值。 |
OnHandleChanged | 在控制手柄被拖到场景中时使用的回调。 |
SetSize | 设置此实例包围体积的当前大小。 |
DefaultMidpointHandleSizeFunction | 返回一个固定屏幕空间尺寸的 SizeFunction。 |
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.