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