Input Field Text#
UI / Interaction / Input Field / Input Field Text
Can Read
Can Write
Description#
The Text property of the 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;
namespace VisualScript.Runtime
{
[Get]
[Set]
[Title("Input Field Text")]
[Category("UI/Interaction/Input Field/Text")]
[Description("The Text property of the Input Field component")]
[Image(typeof(IconUIInputField), ColorTheme.Type.TextLight)]
[Keywords("UI, User, Interface")]
[Serializable]
public class GenTypeString_InputField_Text : TypeString
{
[SerializeField] private GetGameObject m_InputField = new GetGameObject(
new GenTypeGameObject_InputField()
);
public override string GetPreview(GameObject source)
{
GameObject instance = this.m_InputField.GetPreview(source);
if (instance == null) return default;
InputField component = instance.GetComponent<InputField>();
return component != null ? component.text : default;
}
public override string Get(Args args)
{
InputField instance = this.m_InputField.Get<InputField>(args);
return instance != null
? instance.text
: default;
}
public override void Set(string value, Args args)
{
InputField component = this.m_InputField.Get<InputField>(args);
if (component != null) component.text = (string) value;
}
public override string ToString()
{
return $"{this.m_InputField} Text";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}