Attributes.cs 966 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using UnityEngine.Scripting;
  2. namespace SRF.Service
  3. {
  4. using System;
  5. [AttributeUsage(AttributeTargets.Class)]
  6. public sealed class ServiceAttribute : PreserveAttribute
  7. {
  8. public ServiceAttribute(Type serviceType)
  9. {
  10. ServiceType = serviceType;
  11. }
  12. public Type ServiceType { get; private set; }
  13. }
  14. [AttributeUsage(AttributeTargets.Method)]
  15. public sealed class ServiceSelectorAttribute : PreserveAttribute
  16. {
  17. public ServiceSelectorAttribute(Type serviceType)
  18. {
  19. ServiceType = serviceType;
  20. }
  21. public Type ServiceType { get; private set; }
  22. }
  23. [AttributeUsage(AttributeTargets.Method)]
  24. public sealed class ServiceConstructorAttribute : PreserveAttribute
  25. {
  26. public ServiceConstructorAttribute(Type serviceType)
  27. {
  28. ServiceType = serviceType;
  29. }
  30. public Type ServiceType { get; private set; }
  31. }
  32. }