Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / item / weapon / RegisterWeaponFunction.cs
@小李xl 小李xl on 27 Aug 2022 462 bytes 抽象出ThrowComponent组件
using System;

/// <summary>
/// 用作静态函数上, 用于注册武器, 函数必须返回一个 Weapon 对象, 且参数为 string id, 
/// 那么它看起来应该像这样: static Weapon Method(string id);
/// </summary>
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public class RegisterWeaponFunction : Attribute
{
    public string Id { get; private set; }

    public RegisterWeaponFunction(string id)
    {
        Id = id;
    }
}