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.

28 lines
736B

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