Version: 2020.1
public RectOffset overflow ;

描述

要添加到背景图像的额外空间。

如果您的图像具有投影并且您希望将背景图像扩展到为使用该样式的 GUI 元素指定的矩形之外,则可以使用该方法。

using UnityEngine;

public class Example : MonoBehaviour { // Prints the left, right, top and down values of the GUIStyle overflow

RectOffset rctOff;

void OnGUI() { rctOff = GUI.skin.button.overflow; Debug.Log("Left: " + rctOff.left + " Right: " + rctOff.right); Debug.Log("Top: " + rctOff.top + " Bottom: " + rctOff.bottom); } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961