Rasagar/Library/PackageCache/com.unity.visualeffectgraph/Runtime/Utilities/EventBinding/Implementation/VFXVisibilityEventBinder.cs
2024-08-26 23:07:20 +03:00

33 lines
815 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace UnityEngine.VFX.Utility
{
[RequireComponent(typeof(Renderer))]
class VFXVisibilityEventBinder : VFXEventBinderBase
{
public enum Activation
{
OnBecameVisible,
OnBecameInvisible
}
public Activation activation = Activation.OnBecameVisible;
protected override void SetEventAttribute(object[] parameters) { }
private void OnBecameVisible()
{
if (activation != Activation.OnBecameVisible) return;
SendEventToVisualEffect();
}
private void OnBecameInvisible()
{
if (activation != Activation.OnBecameInvisible) return;
SendEventToVisualEffect();
}
}
}