/
TON618OFF
/
Unity-Project-RTU
Обзор
Документация
Войти
/
TON618OFF
/
Unity-Project-RTU
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Library/PackageCache/com.unity.visualscripting@1.9.4/Runtime/VisualScripting.Flow/Framework/Events/GUI/OnDropdownValueChanged.cs
43 строки
1 KB
TON618OFF
release
03 окт 2024, 22:20
03 окт 2024, 22:20
7c70e9f
Код
Авторство
О чём код?
using System; using UnityEngine.UI; namespace Unity.VisualScripting { /// <summary> /// Called when the current value of the dropdown has changed. /// </summary> [UnitCategory("Events/GUI")] [TypeIcon(typeof(Dropdown))] [UnitOrder(4)] public sealed class OnDropdownValueChanged : GameObjectEventUnit<int> { public override Type MessageListenerType => typeof(UnityOnDropdownValueChangedMessageListener); protected override string hookName => EventHooks.OnDropdownValueChanged; /// <summary> /// The index of the newly selected option. /// </summary> [DoNotSerialize] public ValueOutput index { get; private set; } /// <summary> /// The text of the newly selected option. /// </summary> [DoNotSerialize] public ValueOutput text { get; private set; } protected override void Definition() { base.Definition(); index = ValueOutput<int>(nameof(index)); text = ValueOutput<string>(nameof(text)); } protected override void AssignArguments(Flow flow, int index) { flow.SetValue(this.index, index); flow.SetValue(text, flow.GetValue<Dropdown>(target).options[index].text); } } }