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

Function GetOrAddChild

Source/Engine/Level/Actor.h:260–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258 /// <returns>The child actor.</returns>
259 template<typename T>
260 T* GetOrAddChild()
261 {
262 T* result = (T*)GetChild(T::GetStaticClass());
263 if (!result)
264 {
265 result = New<T>();
266 result->SetParent(this, false, false);
267 }
268 return result;
269 }
270
271 /// <summary>
272 /// Gets the child actors of the given type.

Callers

nothing calls this directly

Calls 2

GetChildFunction · 0.85
SetParentMethod · 0.45

Tested by

no test coverage detected