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

Event#

Components / Event / Event

  • Can Read

  • Cannot Write

Description#

The Event component attached to a Game Object

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]
    
    [Inline(nameof(m_Value), typeof(Event), true)]
    
    [Title("Event")]
    [Category("Components/Event/Event")]
    [Description("The Event component attached to a Game Object")]
    
    [Image(typeof(IconInstructions), ColorTheme.Type.TextLight)]
    [Keywords("Instructions", "Conditions", "Triggers", "Event")]
    
    [Serializable]
    public class TypeGameObjectComponentEvent : TypeGameObject
    {
        [SerializeField] private Event m_Value;
        
        public TypeGameObjectComponentEvent()
        {
            this.m_Value = null;
        }
        
        public TypeGameObjectComponentEvent(Event component)
        {
            this.m_Value = component;
        }

        public override GameObject GetPreview(GameObject source) =>
            this.m_Value != null
                ? this.m_Value.gameObject
                : null;

        public override GameObject Get(Args args)
        {
            return this.m_Value != null
                ? this.m_Value.gameObject
                : null;
        }
        
        public override U Get<U>(Args args)
        {
            if (typeof(U) == typeof(Event))
            {
                return this.m_Value != null
                    ? this.m_Value as U
                    : null;
            }
            
            return base.Get<U>(args);
        }
        
        public override string ToString()
        {
            return TextUtils.Name(this.m_Value);
        }
        
        protected override SubscriptionMode Subscription => SubscriptionMode.OnEditorChange;
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.