On Enable#
Component / On Enable
Description#
Executes when the game object or component attached is enabled
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Title("On Enable")]
[Image(typeof(IconArrowCircleRight), ColorTheme.Type.Lime)]
[Description("Executes when the game object or component attached is enabled")]
[Category("Component/On Enable")]
[Keywords("Initialize", "Setup", "Activate", "Active")]
[Serializable]
public class TriggerCoreEnable : Trigger
{
protected override string GetTitle(GameObject source) => "Enable";
public override void OnEnable()
{
base.OnEnable();
using Args args = Args.Get(this.Component, this.Component);
this.Run(args);
}
}
}