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

GUILayout.RepeatButton

Объявление

public static bool RepeatButton(Texture image, params GUILayoutOption[] options);

public static bool RepeatButton(string text, params GUILayoutOption[] options);

public static bool RepeatButton(GUIContent content, params GUILayoutOption[] options);

public static bool RepeatButton(Texture image, GUIStyle style, params GUILayoutOption[] options);

public static bool RepeatButton(string text, GUIStyle style, params GUILayoutOption[] options);

public static bool RepeatButton(GUIContent content, GUIStyle style, params GUILayoutOption[] options);

Параметры

text Текст для отображения на кнопке.
image Текстура для отображения на кнопке.
content Текст, изображение и всплывающая подсказка для этой кнопки.
style Используемый стиль. Если его не указать, используется стиль button из текущего GUISkin.
options Необязательный список параметров макета, определяющих дополнительные свойства макета. Любые переданные здесь значения переопределяют настройки, заданные style.
Смотрите так же: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.

Возвращает

booltrue когда удерживает мышь.

Описание

Создайте повторяющуюся кнопку. Кнопка возвращает значение true, пока пользователь удерживает кнопку мыши.

Repeat Buttons in the Game View.
using UnityEngine; public class ExampleScript : MonoBehaviour { // Draws a button with an image and a button with text Texture tex; void OnGUI() { if (!tex) { Debug.LogError("No texture found, please assign a texture on the inspector"); } if (GUILayout.RepeatButton(tex)) { Debug.Log("Clicked the image"); } if (GUILayout.RepeatButton("I am a regular Automatic LayoutButton")) { Debug.Log("Clicked Button"); } } }
Вы можете отблагодарить автора, за перевод документации на русский язык. ₽ Спасибо
API скрипты 2021.3