Version: 2021.3

GUIStyle.stretchWidth

切换到手册
public bool stretchWidth ;

描述

是否可以水平拉伸该样式的 GUI 元素来改善布局效果?

using UnityEngine;

public class Example : MonoBehaviour { void OnGUI() { GUI.skin.button.stretchWidth = true; } }