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