Set Input Field Caret Width#
UI / Interaction / Input Field / Set Input Field Caret Width
Description#
Sets the Caret Width 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 Caret Width")]
[Category("UI/Interaction/Input Field/Caret Width")]
[Description("Sets the Caret Width property of Input Field component")]
[Image(typeof(IconUIInputField), ColorTheme.Type.TextLight)]
[Keywords("UI, User, Interface")]
[Parameter("Input Field")]
[Parameter("Value")]
[Serializable]
public class GenInstructionInteger_InputField_SetCaretWidth : Instruction
{
[SerializeField] private GetGameObject m_InputField = new GetGameObject(
new GenTypeGameObject_InputField()
);
[SerializeField] private GetInteger m_Value = new GetInteger();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Caret Width");
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.caretWidth = (int) this.m_Value.Get(args);
return Done;
}
}
}