Version: 2020.2
public static GUILayoutOption Height (float height);

描述

传递给控件以使其具有绝对高度的选项。

注意:该选项将覆盖自动高度布局参数

\ GUI 控件的固定高度。

using UnityEngine;

public class ExampleScript : MonoBehaviour { // Draws a button with a fixed height void OnGUI() { GUILayout.Button("A Button with fixed height", GUILayout.Height(300)); } }