Dropdown - TextMeshPro Value#
UI / Interaction / Dropdown - TextMeshPro / Dropdown - TextMeshPro Value
Can Read
Can Write
Description#
The Value property of the Dropdown - TextMeshPro component
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;
using TMPro;
namespace VisualScript.Runtime
{
[Get]
[Set]
[Title("Dropdown - TextMeshPro Value")]
[Category("UI/Interaction/Dropdown - TextMeshPro/Value")]
[Description("The Value property of the Dropdown - TextMeshPro component")]
[Image(typeof(IconUIDropdown), ColorTheme.Type.Blue)]
[Keywords("UI, User, Interface, TMP, Text, Mesh, Pro")]
[Serializable]
public class GenTypeInteger_TMP_Dropdown_Value : TypeNumber
{
[SerializeField] private GetGameObject m_TMP_Dropdown = new GetGameObject(
new GenTypeGameObject_TMP_Dropdown()
);
public override double GetPreview(GameObject source)
{
GameObject instance = this.m_TMP_Dropdown.GetPreview(source);
if (instance == null) return default;
TMP_Dropdown component = instance.GetComponent<TMP_Dropdown>();
return component != null ? component.value : default;
}
public override double Get(Args args)
{
TMP_Dropdown instance = this.m_TMP_Dropdown.Get<TMP_Dropdown>(args);
return instance != null
? instance.value
: default;
}
public override void Set(double value, Args args)
{
TMP_Dropdown component = this.m_TMP_Dropdown.Get<TMP_Dropdown>(args);
if (component != null) component.value = (int) value;
}
public override string ToString()
{
return $"{this.m_TMP_Dropdown} Value";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}