📅  最后修改于: 2022-03-11 14:49:13.999000             🧑  作者: Mango
void Main()
{
ControlCharacter control = new ControlCharacter();
control.GetType()
.GetMethods(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)
.Where(method => method.GetCustomAttribute() == null)
.Select(method => method.Name)
.ToList()
.ForEach(Console.WriteLine);
}
[AttributeUsage(AttributeTargets.Method)]
public class RPC : Attribute
{
}
public class NetworkBehavior
{
}
public class ControlCharacter : NetworkBehavior
{
[RPC]
public void Move() { }
public void DrawHud() { }
}