MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / SpawnParticles

Method SpawnParticles

Source/Engine/Particles/ParticleEffect.cpp:288–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286}
287
288void ParticleEffect::SpawnParticles(int32 count, const StringView& emitterTrackName)
289{
290 auto system = ParticleSystem.Get();
291 if (!system)
292 return;
293 if (emitterTrackName.IsEmpty())
294 {
295 for (auto& e : Instance.Emitters)
296 e.CustomSpawnCount += count;
297 }
298 else
299 {
300 for (int32 i = 0; i < system->Tracks.Count(); i++)
301 {
302 auto& track = system->Tracks[i];
303 if (track.Type == ParticleSystem::Track::Types::Emitter && track.Name == emitterTrackName)
304 {
305 const int32 emitterIndex = track.AsEmitter.Index;
306 if (Instance.Emitters.IsValidIndex(emitterIndex))
307 {
308 Instance.Emitters.Get()[emitterIndex].CustomSpawnCount += count;
309 break;
310 }
311 }
312 }
313 }
314}
315
316void ParticleEffect::Play()
317{

Callers

nothing calls this directly

Calls 4

IsValidIndexMethod · 0.80
GetMethod · 0.45
IsEmptyMethod · 0.45
CountMethod · 0.45

Tested by

no test coverage detected