| 286 | } |
| 287 | |
| 288 | void 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 | |
| 316 | void ParticleEffect::Play() |
| 317 | { |
nothing calls this directly
no test coverage detected