Mirror of Svelto.ECS because we're a fan of it
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
760B

  1. #if UNITY_5 || UNITY_5_3_OR_NEWER
  2. using Svelto.ECS.Hybrid;
  3. using UnityEngine;
  4. namespace Svelto.ECS.Extensions.Unity
  5. {
  6. public abstract class GenericEntityDescriptorHolder<T>: MonoBehaviour, IEntityDescriptorHolder
  7. where T: IEntityDescriptor, new()
  8. {
  9. public IEntityDescriptor GetDescriptor()
  10. {
  11. return EntityDescriptorTemplate<T>.descriptor;
  12. }
  13. public T GetRealDescriptor()
  14. {
  15. return EntityDescriptorTemplate<T>.realDescriptor;
  16. }
  17. public string groupName => _groupName;
  18. public ushort id => _id;
  19. #pragma warning disable 649
  20. [SerializeField] string _groupName;
  21. [SerializeField] ushort _id;
  22. #pragma warning restore 649
  23. }
  24. }
  25. #endif