soundvision/UnityProject/Assets/Scenes/Examples/VisualEffectGraph/script/FlareBind.cs

14 lines
328 B
C#
Raw Normal View History

2019-10-03 09:43:11 +00:00
using UnityEngine;
2020-03-04 20:47:24 +00:00
using UnityEngine.VFX;
2019-10-03 09:43:11 +00:00
public class FlareBind : MonoBehaviour
{
2019-10-04 19:58:32 +00:00
[SerializeField] private VisualEffect flareEffect = null;
2019-10-03 09:43:11 +00:00
private static readonly string Spread = "spread";
public void OnEnergyChanged(float energy)
{
2019-10-04 18:30:18 +00:00
flareEffect.SetFloat(Spread, energy * 0.1f + 0.1f);
2019-10-03 09:43:11 +00:00
}
}