用于管理 GetIconSize/SetIconSize 的可处置的作用域 Helper 类。
将此作用域中渲染成 GUIContent 部分的图标设置为按特定大小进行渲染。
另请参阅:GetIconSize。
另请参阅:SetIconSize。
class ExampleClass
{
void ExampleMethod()
{
var myIconSize = new Vector2(16, 16);
using (new IconSizeScope(myIconSize))
{
// Block of code that may render icons as part of GUIContent
// Icons rendered here will use myIconSize
}
// Code here now reverts to original icon size
}
}
| EditorGUIUtility.IconSizeScope | 开始一个 IconSizeScope。 |