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.
21 lines
509 B
21 lines
509 B
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); |
|
} |
|
}
|
|
|