Version: 2017.2
public RectOffset padding ;

描述

GUIStyle 边缘到内容起始处的空间。

using UnityEngine;
using System.Collections;

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