mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
fix: Weaver Generated Cmd/Rpc should be private (#2799)
* Fix for users calling weaver gen'd methods in the inspector Forces the new weaver generated method to be private, preventing prevents users from mistakenly calling weaver generated methods in dropdown menus (such as buttons) in the inspector. * Update Assets/Mirror/Editor/Weaver/Processors/MethodProcessor.cs Co-authored-by: vis2k <info@noobtuts.com>
This commit is contained in:
parent
5528bdd27e
commit
74ae04d222
@ -35,6 +35,12 @@ public static MethodDefinition SubstituteMethod(TypeDefinition td, MethodDefinit
|
||||
string newName = RpcPrefix + md.Name;
|
||||
MethodDefinition cmd = new MethodDefinition(newName, md.Attributes, md.ReturnType);
|
||||
|
||||
// force new usercode_cmd to be private.
|
||||
// otherwise the generated User_Cmd could be assigned to UnityEvents in the Inspector
|
||||
// (User_Cmd() is only called by Invoke_Cmd in this class)
|
||||
cmd.IsPublic = false;
|
||||
cmd.IsPrivate = true;
|
||||
|
||||
// add parameters
|
||||
foreach (ParameterDefinition pd in md.Parameters)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user