Version: 2017.3
public static void FlexibleSpace ();

설명

Insert a flexible space element.

Flexible spaces use up any leftover space in a layout.

Note: This will override the GUILayout.ExpandWidth and GUILayout.ExpandHeight


Flexible Space in a GUILayout Area.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public float sliderValue = 1.0F; void OnGUI() { GUILayout.BeginArea(new Rect(0, 0, 200, 60)); GUILayout.BeginHorizontal(); GUILayout.RepeatButton("A button with\ntwo lines"); GUILayout.FlexibleSpace(); GUILayout.BeginVertical(); GUILayout.Box("Value:" + Mathf.Round(sliderValue)); sliderValue = GUILayout.HorizontalSlider(sliderValue, 0.0F, 10); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.EndArea(); } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961