ComponentOfAttribute.cs 490 B

1234567891011121314151617181920
  1. using System;
  2. namespace ET
  3. {
  4. /// <summary>
  5. /// 组件类父级实体类型约束
  6. /// 父级实体类型唯一的 标记指定父级实体类型[ComponentOf(typeof(parentType)]
  7. /// 不唯一则标记[ComponentOf]
  8. /// </summary>
  9. [AttributeUsage(AttributeTargets.Class)]
  10. public class ComponentOfAttribute : Attribute
  11. {
  12. public Type Type;
  13. public ComponentOfAttribute(Type type = null)
  14. {
  15. this.Type = type;
  16. }
  17. }
  18. }