Browse Source

fixed wrong behaviour

tags/Rel2b2
sebas77 6 years ago
parent
commit
d825dbd373
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      Svelto.ECS/EntityViewsDB.cs

+ 7
- 3
Svelto.ECS/EntityViewsDB.cs View File

@@ -65,12 +65,16 @@ namespace Svelto.ECS.Internal
var type = typeof(T);
count = 0;
Dictionary<Type, ITypeSafeList> entityViews;
Dictionary<Type, ITypeSafeList> entitiesInGroupPerType;
if (_groupEntityViewsDB.TryGetValue(group, out entitiesInGroupPerType) == false)
return RetrieveEmptyEntityViewArray<T>();
if (_groupEntityViewsDB.TryGetValue(group, out entityViews) == false)
ITypeSafeList outList;
if (entitiesInGroupPerType.TryGetValue(typeof(T), out outList) == false)
return RetrieveEmptyEntityViewArray<T>();
return FasterList<T>.NoVirt.ToArrayFast((FasterList<T>)entityViews[type], out count);
return FasterList<T>.NoVirt.ToArrayFast((FasterList<T>)entitiesInGroupPerType[type], out count);
}

public ReadOnlyDictionary<int, T> QueryIndexableEntityViews<T>() where T:EntityView


Loading…
Cancel
Save