Version: 2021.2
言語: 日本語
public RectOffset margin ;

説明

このスタイルでレンダリングされる要素とその他の GUI 要素間の余白

自動レイアウトを使用する場合のみ効果あります (参照: GUILayout )。

using UnityEngine;

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

RectOffset rctOff;

void OnGUI() { rctOff = GUI.skin.button.margin; Debug.Log("Left: " + rctOff.left + " Right: " + rctOff.right); Debug.Log("Top: " + rctOff.top + " Bottom: " + rctOff.bottom); } }