Version: 2017.3
public RectOffset border ;

描述

所有背景图像的边框。

这对应于 GUITexture 的边框设置。它只影响背景图像的渲染,不影响定位。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { private RectOffset bdr; void OnGUI() { bdr = GUI.skin.button.border; Debug.Log("Left: " + bdr.left + " Right: " + bdr.right); Debug.Log("Top: " + bdr.top + " Bottom: " + bdr.bottom); } }