传递给控件以允许或禁止水平扩展的选项。
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { void OnGUI() { GUILayout.BeginVertical(); GUILayout.Button("Short Button", GUILayout.ExpandWidth(false)); GUILayout.Button("Very very long Button"); GUILayout.EndVertical(); } }