Particle System On/Off

Hey, I have that day night cycle and i want to add stars in the sky at night, i made the particle system, but how can i turn it on and off depending on the intensity of the sun(Directional Light)? Please help!
Thanks

Edwin

Hey Edwin,

If you want them to just turn on and off at night you can just go

//Your particle system GameObject
gameObject.SetActive(false);
gameObject.setActive(true);

If you have a timer for the current time you can just check when it changes to day and toggle the GameObject.

if you want to get fancy you can just fade the systems color over time in dawn and dusk.

Regards,

if(light.intensity > light value)
particleSystem.enableEmission = false;
else
particleSystem.enableEmission = true;

Next time please try to attempt it on your own. Use Google because this has been answered before.