Мои Уведомления
Привет, !
Мой Аккаунт Мои Финансы Мои Подписки Мои Настройки Выход
Руководство API скрипты

GUILayout.FlexibleSpace

Объявление

public static void FlexibleSpace();

Описание

Вставьте гибкий элемент пробела.

Гибкие пробелы используют все оставшееся пространство в макете.

Примечание. Это переопределит GUILayout.ExpandWidth и GUILayout.ExpandHeight

Гибкое пространство в области GUILayout.
using UnityEngine; public class ExampleScript : MonoBehaviour { float sliderValue = 1.0f; void OnGUI() { // Wrap everything in the designated GUI Area GUILayout.BeginArea(new Rect(0, 0, 200, 60)); // Begin the singular Horizontal GroupGUILayout.BeginHorizontal(); // Place a Button normally GUILayout.RepeatButton("A button with\ntwo lines"); // Place a space between the button and the vertical area // so it fits the whole area GUILayout.FlexibleSpace(); // Arrange two more Controls vertically beside the ButtonGUILayout.BeginVertical(); GUILayout.Box("Value:" + Mathf.Round(sliderValue)); sliderValue = GUILayout.HorizontalSlider(sliderValue, 0.0f, 10f); // End the Groups and Area GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.EndArea(); } }
Вы можете отблагодарить автора, за перевод документации на русский язык. ₽ Спасибо
API скрипты 2021.3