I have a custom attribute that can be applied to methods. How would I go about getting a callback when a tagged function is called?
class RPC : Attribute
{
private string RPCName;
public RPC (string RPCName)
{
this.RPCName = RPCName;
}
}
How would I go about knowing when such a function is called:
[RPC("shoot")]
public static void shoot(int testParameter)
{
Console.WriteLine("Shoot was called.");
}