기술 자료

Unity Engine

Unity Engine

margin

The margins between elements rendered in this style and any other GUI elements.
읽는 시간 1분최근 업데이트: 한 달 전

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.IMGUIModule
public RectOffset margin { get; set; }

Remarks

This only has effect when using automatic layout (Additional Resources: GUILayout).

Examples

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); }}