| 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 | { |
nothing calls this directly
no test coverage detected