Dropdown - TextMeshPro Item Text#
UI / Interaction / Dropdown - TextMeshPro / Dropdown - TextMeshPro Item Text
Can Read
Can Write
Description#
The Item Text 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 Item Text")]
[Category("UI/Interaction/Dropdown - TextMeshPro/Item Text")]
[Description("The Item Text property of the Dropdown - TextMeshPro component")]
[Image(typeof(IconUIDropdown), ColorTheme.Type.Blue)]
[Keywords("UI, User, Interface, TMP, Text, Mesh, Pro")]
[Serializable]
public class GenTypeGameObject_TMP_Dropdown_ItemText : TypeGameObject
{
[SerializeField] private GetGameObject m_TMP_Dropdown = new GetGameObject(
new GenTypeGameObject_TMP_Dropdown()
);
public override GameObject 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.itemText.gameObject : default;
}
public override GameObject Get(Args args)
{
TMP_Dropdown instance = this.m_TMP_Dropdown.Get<TMP_Dropdown>(args);
return instance != null
? instance.itemText.gameObject
: default;
}
public override U Get<U>(Args args)
{
if (typeof(U) == typeof(TMP_Dropdown))
{
TMP_Dropdown instance = this.m_TMP_Dropdown.Get<TMP_Dropdown>(args);
return instance != null
? instance.itemText as U
: default;
}
return base.Get<U>(args);
}
public override void Set(GameObject value, Args args)
{
TMP_Dropdown component = this.m_TMP_Dropdown.Get<TMP_Dropdown>(args);
if (component != null) component.itemText = (TMP_Text) value.Get<TMPro.TMP_Text>();
}
public override void Set<U>(U value, Args args)
{
if (typeof(U) == typeof(TMP_Text))
{
TMP_Dropdown component = this.m_TMP_Dropdown.Get<TMP_Dropdown>(args);
if (component != null) component.itemText = value as TMP_Text;
}
base.Set<U>(value, args);
}
public override string ToString()
{
return $"{this.m_TMP_Dropdown} Item Text";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}