On Become Invisible#
Component / Visibility / On Become Invisible
Description#
Executes when the targeted game object becomes invisible by any camera
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Title("On Become Invisible")]
[Image(typeof(IconGhostOutline), ColorTheme.Type.TextLight)]
[Description("Executes when the targeted game object becomes invisible by any camera")]
[Category("Component/Visibility/On Become Invisible")]
[Keywords("Render", "Frustum", "See")]
[Serializable]
public class TriggerCoreBecomeInvisible : TriggerHandleSourceBase<HandleOnBecomeInvisible>
{
// PROPERTIES: ----------------------------------------------------------------------------
protected override string GetTitle(GameObject source) => $"{this.SourceName} Become Invisible";
// OVERRIDE METHODS: ----------------------------------------------------------------------
protected override void OnTrigger(GameObject target)
{
using Args args = Args.Get(this.Component, target);
this.Run(args);
}
}
}