Mirror of Svelto.ECS because we're a fan of it
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

55 líneas
1.3KB

  1. #if UNITY_ECS
  2. using Unity.Entities;
  3. namespace Svelto.ECS.SveltoOnDOTS
  4. {
  5. /// <summary>
  6. /// DOTS component to keep track of the associated Svelto.ECS entity
  7. /// </summary>
  8. public struct DOTSSveltoEGID : IComponentData
  9. {
  10. public EGID egid;
  11. public DOTSSveltoEGID(EGID egid) { this.egid = egid; }
  12. }
  13. /// <summary>
  14. /// DOTS component to be able to query all the DOTS entities found in a Svelto.ECS group
  15. /// </summary>
  16. public readonly struct DOTSSveltoGroupID : ISharedComponentData
  17. {
  18. readonly ExclusiveGroupStruct group;
  19. public DOTSSveltoGroupID(ExclusiveGroupStruct exclusiveGroup)
  20. {
  21. @group = exclusiveGroup;
  22. }
  23. public static implicit operator ExclusiveGroupStruct(DOTSSveltoGroupID group)
  24. {
  25. return group.@group;
  26. }
  27. }
  28. struct DOTSEntityToSetup : ISharedComponentData
  29. {
  30. internal readonly ExclusiveGroupStruct group;
  31. public DOTSEntityToSetup(ExclusiveGroupStruct exclusiveGroup)
  32. {
  33. @group = exclusiveGroup;
  34. }
  35. }
  36. public interface IEntityComponentForDOTS: IEntityComponent
  37. {
  38. public Entity dotsEntity { get; set; }
  39. }
  40. public struct DOTSEntityComponent:IEntityComponentForDOTS
  41. {
  42. public Entity dotsEntity { get; set; }
  43. }
  44. }
  45. #endif