/
TON618OFF
/
Unity-Project-RTU
Обзор
Документация
Войти
/
TON618OFF
/
Unity-Project-RTU
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Library/PackageCache/com.unity.visualscripting@1.9.4/Runtime/VisualScripting.Flow/Framework/Variables/Obsolete/GetVariableUnit.cs
42 строки
1 KB
TON618OFF
release
03 окт 2024, 22:20
03 окт 2024, 22:20
7c70e9f
Код
Авторство
О чём код?
#pragma warning disable 618 namespace Unity.VisualScripting { [UnitShortTitle("Get Variable")] public abstract class GetVariableUnit : VariableUnit { protected GetVariableUnit() : base() { } protected GetVariableUnit(string defaultName) : base(defaultName) { } /// <summary> /// The value of the variable. /// </summary> [DoNotSerialize] [PortLabelHidden] public ValueOutput value { get; private set; } protected override void Definition() { base.Definition(); value = ValueOutput(nameof(value), Get).PredictableIf(IsDefined); Requirement(name, value); } protected virtual bool IsDefined(Flow flow) { var name = flow.GetValue<string>(this.name); return GetDeclarations(flow)?.IsDefined(name) ?? false; } protected virtual object Get(Flow flow) { var name = flow.GetValue<string>(this.name); return GetDeclarations(flow).Get(name); } } }