Rasagar/Library/PackageCache/com.unity.visualeffectgraph/Runtime/CustomSpawners/SetSpawnTime.cs

25 lines
741 B
C#
Raw Normal View History

2024-08-26 13:07:20 -07:00
using System;
using UnityEngine;
using UnityEngine.VFX;
namespace UnityEngine.VFX
{
class SetSpawnTime : VFXSpawnerCallbacks
{
private static readonly int spawnTimeID = Shader.PropertyToID("spawnTime");
public sealed override void OnPlay(VFXSpawnerState state, VFXExpressionValues vfxValues, VisualEffect vfxComponent)
{
}
public sealed override void OnUpdate(VFXSpawnerState state, VFXExpressionValues vfxValues, VisualEffect vfxComponent)
{
state.vfxEventAttribute.SetFloat(spawnTimeID, state.totalTime);
}
public sealed override void OnStop(VFXSpawnerState state, VFXExpressionValues vfxValues, VisualEffect vfxComponent)
{
}
}
}