| 379 | } |
| 380 | |
| 381 | uint32_t GetMaxComponentInstances(uint64_t name_hash, dmGameObjectDDF::CollectionDesc* collection_desc) |
| 382 | { |
| 383 | if (!collection_desc || collection_desc->m_ComponentTypes.m_Count == 0) |
| 384 | { |
| 385 | return 0xFFFFFFFF; |
| 386 | } |
| 387 | for (uint32_t i = 0; i < collection_desc->m_ComponentTypes.m_Count; ++i) |
| 388 | { |
| 389 | const dmGameObjectDDF::ComponenTypeDesc& type_desc = collection_desc->m_ComponentTypes[i]; |
| 390 | if (name_hash == type_desc.m_NameHash) |
| 391 | { |
| 392 | return type_desc.m_MaxCount; |
| 393 | } |
| 394 | } |
| 395 | return 0; |
| 396 | } |
| 397 | |
| 398 | Collection* AllocCollection(const char* name, HRegister regist, uint32_t max_instances, dmGameObjectDDF::CollectionDesc* collection_desc) |
| 399 | { |