You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
509 B
22 lines
509 B
2 years ago
|
using UnityEngine;
|
||
|
|
||
|
[RequireComponent(typeof(ParticleSystem))]
|
||
|
public class TOD_ParticleAtTime : MonoBehaviour
|
||
|
{
|
||
|
public AnimationCurve Emission = new AnimationCurve() {
|
||
|
keys = new Keyframe[] { new Keyframe(0, 0), new Keyframe(12, 1), new Keyframe(24, 0) }
|
||
|
};
|
||
|
|
||
|
private ParticleSystem particleComponent;
|
||
|
|
||
|
protected void Start()
|
||
|
{
|
||
|
particleComponent = GetComponent<ParticleSystem>();
|
||
|
}
|
||
|
|
||
|
protected void Update()
|
||
|
{
|
||
|
particleComponent.emissionRate = Emission.Evaluate(TOD_Sky.Instance.Cycle.Hour);
|
||
|
}
|
||
|
}
|