CapersProject/Assets/Plugins/AllIn1VfxToolkit/Scripts/All1VfxRandomTimeSeed.cs

17 lines
520 B
C#
Raw Normal View History

2025-02-10 05:47:48 +00:00
using UnityEngine;
namespace AllIn1VfxToolkit
{
public class All1VfxRandomTimeSeed : MonoBehaviour
{
[SerializeField] private float minSeedValue = 0;
[SerializeField] private float maxSeedValue = 100f;
private void Start()
{
MaterialPropertyBlock properties = new MaterialPropertyBlock();
properties.SetFloat("_TimingSeed", Random.Range(minSeedValue, maxSeedValue));
GetComponent<Renderer>().SetPropertyBlock(properties);
}
}
}