Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

On Input Field Change#

UI / On Input Field Change

Description#

Executed when the Input Field on the target game object changes its text

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime.UI
{
    [Title("On Input Field Change")]
    [Image(typeof(IconUIInputField), ColorTheme.Type.TextLight)]

    [Description("Executed when the Input Field on the target game object changes its text")]
    [Category("UI/On Input Field Change")]

    [Keywords("UI", "Canvas", "Input", "Field", "Text", "Type", "Write", "Edit", "Submit", "TMP")]

    [Serializable]
    public class TriggerCoreUIInputField : TriggerHandleSourceBase<HandleOnUIInputField>
    {
        // EXPOSED MEMBERS: -----------------------------------------------------------------------

        [SerializeField] private UIInputFieldChange m_When = UIInputFieldChange.EndEdit;

        // PROPERTIES: ----------------------------------------------------------------------------

        protected override string GetTitle(GameObject source) => this.m_When switch
        {
            UIInputFieldChange.ValueChanged => $"{this.SourceName} Input Field Change",
            UIInputFieldChange.EndEdit => $"{this.SourceName} Input Field End Edit",
            UIInputFieldChange.Submit => $"{this.SourceName} Input Field Submit",
            _ => throw new ArgumentOutOfRangeException()
        };

        // OVERRIDE METHODS: ----------------------------------------------------------------------

        protected override void OnTrigger(GameObject target)
        {
            if (this.m_Handle == null || this.m_Handle.Change != this.m_When) return;

            using Args args = Args.Get(this.Component, target);
            this.Run(args);
        }
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.