Dropdown Value#
UI / Interaction / Dropdown / Dropdown Value
Description#
Compares the Value property of Dropdown component to another value
Parameters#
| Name | Description |
|---|---|
| Dropdown | |
| Compare | |
| Value |
Code#
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>
using System;
using UnityEngine;
using VisualScript.Icons;
using UnityEngine.UI;
namespace VisualScript.Runtime
{
[Title("Dropdown Value")]
[Category("UI/Interaction/Dropdown/Value")]
[Description("Compares the Value property of Dropdown component to another value")]
[Image(typeof(IconUIDropdown), ColorTheme.Type.TextLight)]
[Keywords("UI, User, Interface")]
[Parameter("Dropdown")]
[Parameter("Compare")]
[Parameter("Value")]
[Serializable]
public class GenConditionInteger_Dropdown_CheckValue : Condition
{
[SerializeField] private GetGameObject m_Dropdown = new GetGameObject(
new GenTypeGameObject_Dropdown()
);
[SerializeField] private CompareNumber m_Compare = new CompareNumber();
[SerializeField] private GetInteger m_Value = new GetInteger();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Value");
return $"{this.m_Dropdown} {member} {this.m_Compare} {this.m_Value}";
}
protected override bool Run(Args args)
{
Dropdown component = this.m_Dropdown.Get<Dropdown>(args);
if (component == null) return false;
return this.m_Compare.Compare(component.value, (int) this.m_Value.Get(args));
}
}
}