On Disable#
Component / On Disable
Description#
Executes when the game object or component attached is disabled
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Title("On Disable")]
[Image(typeof(IconArrowCircleRight), ColorTheme.Type.Red)]
[Description("Executes when the game object or component attached is disabled")]
[Category("Component/On Disable")]
[Keywords("Deactivate", "Inactive")]
[Serializable]
public class TriggerCoreDisable : Trigger
{
protected override string GetTitle(GameObject source) => "Disable";
public override void OnDisable()
{
base.OnDisable();
using Args args = Args.Get(this.Component, this.Component);
this.Run(args);
}
}
}