@@ -19,14 +19,11 @@ public class NetworkManager : MonoBehaviour, INetworkUpdateSystem, IProfilableTr
19
19
// RuntimeAccessModifiersILPP will make this `public`
20
20
internal static readonly Dictionary < uint , Action < NetworkBehaviour , NetworkSerializer , __RpcParams > > __rpc_func_table = new Dictionary < uint , Action < NetworkBehaviour , NetworkSerializer , __RpcParams > > ( ) ;
21
21
22
- #if UNITY_EDITOR || DEVELOPMENT_BUILD
23
-
22
+ #if DEVELOPMENT_BUILD || UNITY_EDITOR
24
23
// RuntimeAccessModifiersILPP will make this `public`
25
24
internal static readonly Dictionary < uint , string > __rpc_name_table = new Dictionary < uint , string > ( ) ;
26
- #else // !(UNITY_EDITOR || DEVELOPMENT_BUILD)
27
- // RuntimeAccessModifiersILPP will make this `public`
28
- internal static readonly Dictionary < uint , string > __rpc_name_table = null ; // not needed on release builds
29
- #endif // UNITY_EDITOR || DEVELOPMENT_BUILD
25
+ #endif
26
+
30
27
#pragma warning restore IDE1006 // restore naming rule violation check
31
28
32
29
#if DEVELOPMENT_BUILD || UNITY_EDITOR
@@ -35,7 +32,6 @@ public class NetworkManager : MonoBehaviour, INetworkUpdateSystem, IProfilableTr
35
32
private static ProfilerMarker s_TransportConnect = new ProfilerMarker ( $ "{ nameof ( NetworkManager ) } .TransportConnect") ;
36
33
private static ProfilerMarker s_HandleIncomingData = new ProfilerMarker ( $ "{ nameof ( NetworkManager ) } .{ nameof ( HandleIncomingData ) } ") ;
37
34
private static ProfilerMarker s_TransportDisconnect = new ProfilerMarker ( $ "{ nameof ( NetworkManager ) } .TransportDisconnect") ;
38
-
39
35
private static ProfilerMarker s_InvokeRpc = new ProfilerMarker ( $ "{ nameof ( NetworkManager ) } .{ nameof ( InvokeRpc ) } ") ;
40
36
#endif
41
37
@@ -1263,10 +1259,12 @@ internal void InvokeRpc(MessageFrameItem item, NetworkUpdateStage networkUpdateS
1263
1259
1264
1260
__rpc_func_table [ networkMethodId ] ( networkBehaviour , new NetworkSerializer ( item . NetworkReader ) , rpcParams ) ;
1265
1261
1262
+ #if DEVELOPMENT_BUILD || UNITY_EDITOR
1266
1263
if ( __rpc_name_table . TryGetValue ( networkMethodId , out var rpcMethodName ) )
1267
1264
{
1268
1265
NetworkMetrics . TrackRpcReceived ( item . NetworkId , networkObjectId , rpcMethodName , item . StreamSize ) ;
1269
1266
}
1267
+ #endif
1270
1268
}
1271
1269
}
1272
1270
}
0 commit comments