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

Function CompFactoryUnload

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

Source from the content-addressed store, hash-verified

332 }
333
334 bool CompFactoryUnload(HFactoryWorld world, HFactoryComponent component)
335 {
336 FactoryResource* resource = CompFactoryGetResource(world, component);
337 if(!resource->m_LoadDynamically)
338 {
339 return true;
340 }
341 if(component->m_Loading)
342 {
343 dmLogError("Trying to unload factory prototype resource while loading.");
344 return false;
345 }
346 if(resource->m_Prototype)
347 {
348 dmResource::Release(world->m_Factory, resource->m_Prototype);
349 resource->m_Prototype = 0;
350 }
351 return true;
352 }
353
354 // scripting
355 dmResource::HFactory CompFactoryGetResourceFactory(FactoryWorld* world)

Callers 1

FactoryComp_UnloadFunction · 0.85

Calls 2

CompFactoryGetResourceFunction · 0.85
ReleaseFunction · 0.50

Tested by

no test coverage detected