| 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) |
no test coverage detected