MCPcopy Create free account
hub / github.com/defold/defold / CompFactoryDestroy

Function CompFactoryDestroy

engine/gamesys/src/gamesys/components/comp_factory.cpp:171–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169 }
170
171 dmGameObject::CreateResult CompFactoryDestroy(const dmGameObject::ComponentDestroyParams& params)
172 {
173 FactoryWorld* world = (FactoryWorld*)params.m_World;
174 FactoryComponent* component = (FactoryComponent*)*params.m_UserData;
175 CleanupAsyncLoading(dmScript::GetLuaState(((FactoryContext*)params.m_Context)->m_ScriptContext), component);
176 uint32_t index = component - &world->m_Components[0];
177 component->m_Resource = 0x0;
178 if (component->m_CustomResource)
179 dmGameSystem::ResFactoryDestroyResource(world->m_Factory, component->m_CustomResource);
180 component->m_AddedToUpdate = 0;
181 world->m_IndexPool.Push(index);
182 return dmGameObject::CREATE_RESULT_OK;
183 }
184
185 dmGameObject::CreateResult CompFactoryAddToUpdate(const dmGameObject::ComponentAddToUpdateParams& params)
186 {

Callers

nothing calls this directly

Calls 4

CleanupAsyncLoadingFunction · 0.70
GetLuaStateFunction · 0.70
PushMethod · 0.45

Tested by

no test coverage detected