Skip to content

Commit d18cf06

Browse files
fix
Some additional areas in codegen that requires the extended define wrap. Wrapping the RPC invocation tests (we will need to find a better way to get the name for this test).
1 parent ec09106 commit d18cf06

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

com.unity.netcode.gameobjects/Editor/CodeGen/RuntimeAccessModifiersILPP.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,12 @@ private void ProcessNetworkManager(TypeDefinition typeDefinition, string[] assem
106106
{
107107
fieldDefinition.IsPublic = true;
108108
}
109-
109+
#if MULTIPLAYER_TOOLS && (DEVELOPMENT_BUILD || UNITY_EDITOR || UNITY_MP_TOOLS_NET_STATS_MONITOR_ENABLED_IN_RELEASE)
110110
if (fieldDefinition.Name == nameof(NetworkManager.__rpc_name_table))
111111
{
112112
fieldDefinition.IsPublic = true;
113113
}
114+
#endif
114115
}
115116

116117
foreach (var nestedTypeDefinition in typeDefinition.NestedTypes)
@@ -151,11 +152,12 @@ private void ProcessNetworkBehaviour(TypeDefinition typeDefinition)
151152
{
152153
fieldDefinition.IsFamilyOrAssembly = true;
153154
}
154-
155+
#if MULTIPLAYER_TOOLS && (DEVELOPMENT_BUILD || UNITY_EDITOR || UNITY_MP_TOOLS_NET_STATS_MONITOR_ENABLED_IN_RELEASE)
155156
if (fieldDefinition.Name == nameof(NetworkBehaviour.__rpc_name_table))
156157
{
157158
fieldDefinition.IsFamilyOrAssembly = true;
158159
}
160+
#endif
159161
}
160162

161163
foreach (var methodDefinition in typeDefinition.Methods)

com.unity.netcode.gameobjects/Editor/CodeGen/Unity.Netcode.Editor.CodeGen.asmdef

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
"name": "com.unity.nuget.mono-cecil",
2525
"expression": "(0,1.11.4)",
2626
"define": "CECIL_CONSTRAINTS_ARE_TYPE_REFERENCES"
27+
},
28+
{
29+
"name": "com.unity.multiplayer.tools",
30+
"expression": "",
31+
"define": "MULTIPLAYER_TOOLS"
2732
}
2833
],
2934
"noEngineReferences": false

com.unity.netcode.gameobjects/Tests/Runtime/Rpc/RpcInvocationTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#if MULTIPLAYER_TOOLS && (DEVELOPMENT_BUILD || UNITY_EDITOR || UNITY_MP_TOOLS_NET_STATS_MONITOR_ENABLED_IN_RELEASE)
12
using System.Collections;
23
using System.Collections.Generic;
34
using System.Runtime.CompilerServices;
@@ -513,3 +514,4 @@ private static string GetCaller([CallerMemberName] string caller = null)
513514
}
514515
}
515516
}
517+
#endif

0 commit comments

Comments
 (0)