Complete the code to start the particle system.
ParticleSystem ps = GetComponent<ParticleSystem>();
ps.[1]();The Play() method starts the particle system, making the particles visible and active.
Complete the code to set the particle system's emission rate.
var emission = ps.emission;
emission.rateOverTime = [1]f;Setting rateOverTime to 100f means 100 particles emit per second, creating a visible effect.
Fix the error in the code to change particle color.
var main = ps.main;
main.startColor = [1];Color.red is the correct way to specify the red color in Unity's API.
Fill both blanks to create a particle system that emits particles only when active and stops otherwise.
if (isActive) { ps.[1](); } else { ps.[2](); }
Use Play() to start emitting particles and Stop() to stop emitting when inactive.
Fill all three blanks to create a dictionary mapping particle names to their sizes, filtering only large particles.
var sizes = new Dictionary<string, float> {
{"Spark", 0.5f},
{"Flame", 1.2f},
{"Smoke", 2.0f}
};
var largeParticles = sizes.Where(kv => kv.Value [1] [2]).ToDictionary(kv => kv.Key, kv => kv.Value [3] 1);This code filters particles with size greater than 1 and adds 1 to their size in the new dictionary.