Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / item / weapon / RegisterWeapon.cs
@小李xl 小李xl on 27 Aug 2022 535 bytes 抽象出ThrowComponent组件
  1. using System;
  2.  
  3. /// <summary>
  4. /// 用作 Weapon 子类上, 用于注册武器, 允许同时存在多个 RegisterWeapon 特性
  5. /// </summary>
  6. [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
  7. public class RegisterWeapon : Attribute
  8. {
  9.  
  10. public string Id { get; private set; }
  11. public Type AttributeType { get; private set; }
  12.  
  13. public RegisterWeapon(string id)
  14. {
  15. Id = id;
  16. }
  17.  
  18. public RegisterWeapon(string id, Type attributeType)
  19. {
  20. Id = id;
  21. AttributeType = attributeType;
  22. }
  23. }