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

Method Spawn

Source/Engine/Particles/ParticleSystem.cpp:147–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145#endif
146
147ParticleEffect* ParticleSystem::Spawn(Actor* parent, const Transform& transform, bool autoDestroy)
148{
149 PROFILE_MEM(Particles);
150 CHECK_RETURN(!WaitForLoaded(), nullptr);
151
152 auto effect = New<ParticleEffect>();
153 effect->SetTransform(transform);
154 effect->ParticleSystem = this;
155#if !BUILD_RELEASE
156 effect->SetName(_debugName); // Give usable name in development builds
157#endif
158
159 Level::SpawnActor(effect, parent);
160
161 if (autoDestroy)
162 effect->DeleteObject(GetDuration(), true);
163
164 return effect;
165}
166
167void ParticleSystem::InitAsVirtual()
168{

Callers

nothing calls this directly

Calls 4

SetTransformMethod · 0.80
DeleteObjectMethod · 0.80
GetDurationFunction · 0.70
SetNameMethod · 0.45

Tested by

no test coverage detected