Esempio n. 1
0
            public object GetComponentBoxed(Entity entity, Type type)
            {
                m_Manager.EntityComponentStore->AssertEntitiesExist(&entity, 1);

                var archetype = m_Manager.m_EntityComponentStore->GetArchetype(entity);
                var typeIndex = ChunkDataUtility.GetTypeIndexFromType(archetype, type);

#if ENABLE_UNITY_COLLECTIONS_CHECKS
                if (typeIndex == -1)
                {
                    throw new ArgumentException($"A component with type:{type} has not been added to the entity.");
                }
#endif

                return(GetComponentBoxed(entity, ComponentType.FromTypeIndex(typeIndex)));
            }