An example of this is in the SomeNetworkObject.cs used for additive scenes
There is a new function which you can override in a NetworkBehaviour called RegisterCustomRPCs(NetworkObject)
This is called before NetworkStart so the behaviour.networkObject will still be null at this time
hence why it has a argument NetworkObject which is a valid NetworkObject
Inside the RegisterCustomRPCs
you can register RPCs like you normally would except you have can register the RPC and you'll get the id back
then like then you can use the RPC like you normally would
Aside from that you can also register rpcs from another MonoBehaviour
its completely the same as hooking into the
networkBehaviour.networkStarted event but instead we have a custom one for registering rpcs which is networkBehaviour.registerCustomRPCs its completely the same as the parent one and is invoked just after RegisterCustomRPCs(NetworkObject networkObject)
For as testing goes, I use this in Wobbly Life and works for very complicated NetworkBehaviours with multiple Monobehaviours registering rpcs
For testing in the current branch, I've added some example code in SomeNetworkObject.cs
An example of this is in the SomeNetworkObject.cs used for additive scenes There is a new function which you can override in a NetworkBehaviour called RegisterCustomRPCs(NetworkObject)
This is called before NetworkStart so the behaviour.networkObject will still be null at this time hence why it has a argument NetworkObject which is a valid NetworkObject
Inside the RegisterCustomRPCs you can register RPCs like you normally would except you have can register the RPC and you'll get the id back
for example
` private byte RPC_SERVER_TEST_RPC;
`
then like then you can use the RPC like you normally would
Aside from that you can also register rpcs from another MonoBehaviour its completely the same as hooking into the
networkBehaviour.networkStarted event but instead we have a custom one for registering rpcs which is networkBehaviour.registerCustomRPCs its completely the same as the parent one and is invoked just after RegisterCustomRPCs(NetworkObject networkObject)
For as testing goes, I use this in Wobbly Life and works for very complicated NetworkBehaviours with multiple Monobehaviours registering rpcs
For testing in the current branch, I've added some example code in SomeNetworkObject.cs