You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 30, 2018. It is now read-only.
Currently I have an EquipmentEngineBase : ComponentSystem and
EquipmentEngine : EquipmentEngineBase
UnEquipmentEngine : EquipmentEngineBase
When I add these 2 systems the ECS throws an error in ComponentGroup.cs, the type has already been added to the dictionary.
A check if it already contains this type is sufficient and both systems work correctly. I just wonder if it has any negative side effects.
The full code:
public ComponentGroup(EntityManager entityManager, params Type[] componentTypes) {
_entityManager = entityManager;
_groupMatcher = new GroupMatcher(componentTypes);
foreach (Type type in componentTypes) {
Type componentArrayType = typeof(ComponentArray<>);
Type genericComponentArrayType = componentArrayType.MakeGenericType(type);
if (!_components.ContainsKey(type)) // added
_components.Add(type, (ComponentArray)Activator.CreateInstance(genericComponentArrayType));
}
}
The text was updated successfully, but these errors were encountered:
Currently I have an EquipmentEngineBase : ComponentSystem and
When I add these 2 systems the ECS throws an error in ComponentGroup.cs, the type has already been added to the dictionary.
A check if it already contains this type is sufficient and both systems work correctly. I just wonder if it has any negative side effects.
The full code:
The text was updated successfully, but these errors were encountered: