Mirror of Svelto.ECS because we're a fan of it
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

20 行
625B

  1. using Svelto.Common;
  2. using Svelto.ECS.Hybrid;
  3. using Svelto.ECS.Internal;
  4. namespace Svelto.ECS
  5. {
  6. static class TypeSafeDictionaryFactory<T> where T : struct, _IInternalEntityComponent
  7. {
  8. static readonly bool isUnmanaged = TypeCache<T>.isUnmanaged
  9. && typeof(IEntityViewComponent).IsAssignableFrom(typeof(T)) == false;
  10. public static ITypeSafeDictionary Create(uint size)
  11. {
  12. if (isUnmanaged)
  13. return new UnmanagedTypeSafeDictionary<T>(size);
  14. return new ManagedTypeSafeDictionary<T>(size);
  15. }
  16. }
  17. }