Unload resources previously loaded using factory.load * * This decreases the reference count for each resource loaded with factory.load. If reference is zero, the resource is destroyed. * * Calling this function when the factory is not marked as dynamic loading does nothing. * * @name factory.unload * @param [url] [type:string|hash|url] the factory component to u
| 114 | * ``` |
| 115 | */ |
| 116 | static int FactoryComp_Unload(lua_State* L) |
| 117 | { |
| 118 | DM_LUA_STACK_CHECK(L, 0); |
| 119 | |
| 120 | HFactoryWorld world; |
| 121 | HFactoryComponent component; |
| 122 | dmScript::GetComponentFromLua(L, 1, FACTORY_EXT, (dmGameObject::HComponentWorld*)&world, (dmGameObject::HComponent*)&component, 0); |
| 123 | |
| 124 | bool success = dmGameSystem::CompFactoryUnload(world, component); |
| 125 | if (!success) |
| 126 | { |
| 127 | return DM_LUA_ERROR("Error unloading factory resources"); |
| 128 | } |
| 129 | return 0; |
| 130 | } |
| 131 | |
| 132 | |
| 133 | /*# Load resources of a factory prototype. |
nothing calls this directly
no test coverage detected