Complete the code to start the particle system.
ParticleSystem ps = GetComponent<ParticleSystem>();
ps.[1]();The Play() method starts the particle system emitting particles.
Complete the code to check if the particle system is currently playing.
ParticleSystem ps = GetComponent<ParticleSystem>(); if (ps.[1]) { Debug.Log("Particles are playing"); }
The isPlaying property returns true if the particle system is currently playing.
Fix the error in the code to stop the particle system immediately.
ParticleSystem ps = GetComponent<ParticleSystem>();
ps.[1](ParticleSystemStopBehavior.StopEmittingAndClear);The Stop(ParticleSystemStopBehavior.StopEmittingAndClear) method stops the particle system and clears existing particles immediately.
Fill both blanks to create a dictionary of particle systems and check if each is playing.
Dictionary<string, ParticleSystem> systems = new Dictionary<string, ParticleSystem>(); systems.Add("fire", fireParticleSystem); foreach (var [1] in systems) { if ([2].isPlaying) { Debug.Log($"[1].Key is playing"); } }
In a dictionary foreach, each item is a KeyValuePair, so entry is the variable, and entry.Value accesses the ParticleSystem.
Fill all three blanks to emit 10 particles with a specific start color and size.
var main = ps.main; main.startColor = [1]; main.startSize = [2]f; ps.[3](10);
Set startColor to Color.red, startSize to 0.5f, and call Emit(10) to emit 10 particles.