mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
KISS
This commit is contained in:
parent
c868561822
commit
25b2fa9af8
@ -33,23 +33,12 @@ static void ProcessMethods(TypeDefinition td)
|
||||
// find command and RPC functions
|
||||
foreach (MethodDefinition md in td.Methods)
|
||||
{
|
||||
foreach (CustomAttribute ca in md.CustomAttributes)
|
||||
{
|
||||
if (ca.AttributeType.Is<CommandAttribute>())
|
||||
{
|
||||
Weaver.Error($"Command {md.Name} must be declared inside a NetworkBehaviour", md);
|
||||
}
|
||||
|
||||
if (ca.AttributeType.Is<ClientRpcAttribute>())
|
||||
{
|
||||
Weaver.Error($"ClientRpc {md.Name} must be declared inside a NetworkBehaviour", md);
|
||||
}
|
||||
|
||||
if (ca.AttributeType.Is<TargetRpcAttribute>())
|
||||
{
|
||||
Weaver.Error($"TargetRpc {md.Name} must be declared inside a NetworkBehaviour", md);
|
||||
}
|
||||
}
|
||||
if (md.HasCustomAttribute<CommandAttribute>())
|
||||
Weaver.Error($"Command {md.Name} must be declared inside a NetworkBehaviour", md);
|
||||
if (md.HasCustomAttribute<ClientRpcAttribute>())
|
||||
Weaver.Error($"ClientRpc {md.Name} must be declared inside a NetworkBehaviour", md);
|
||||
if (md.HasCustomAttribute<TargetRpcAttribute>())
|
||||
Weaver.Error($"TargetRpc {md.Name} must be declared inside a NetworkBehaviour", md);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user