Set Input Field Placeholder#
UI / Interaction / Input Field / Set Input Field Placeholder
Description#
Sets the Placeholder property of Input Field component
Parameters#
| Name | Description |
|---|---|
| Input Field | |
| Value |
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
{
[Title("Set Input Field Placeholder")]
[Category("UI/Interaction/Input Field/Placeholder")]
[Description("Sets the Placeholder property of Input Field component")]
[Image(typeof(IconUIInputField), ColorTheme.Type.TextLight)]
[Keywords("UI, User, Interface")]
[Parameter("Input Field")]
[Parameter("Value")]
[Serializable]
public class GenInstructionGameObject_InputField_SetPlaceholder : Instruction
{
[SerializeField] private GetGameObject m_InputField = new GetGameObject(
new GenTypeGameObject_InputField()
);
[SerializeField] private GetGameObject m_Value = new GetGameObject();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Placeholder");
return $"{this.m_InputField} {member} = {this.m_Value}";
}
protected override Awaitable Run(Args args)
{
InputField component = this.m_InputField.Get<InputField>(args);
if (component == null) return Done;
component.placeholder = this.m_Value.Get<Graphic>(args);
return Done;
}
}
}