protected void SendTargetRPCInternal(NetworkConnection conn, int rpcHash, NetworkWriter writer, int channelId, string rpcName)
{
// This cannot use NetworkServer.active, as that is not specific to this object.
if (!isServer)
{
if (LogFilter.logWarn)
{
Debug.LogWarning("TargetRpc call on un-spawned object");
}
return;
}
// construct the message
RpcMessage message = new RpcMessage();
message.netId = netId;
message.rpcHash = rpcHash;
message.payload = writer.ToArray();
conn.SendByChannel((short)MsgType.Rpc, message, channelId);
#if UNITY_EDITOR
UnityEditor.NetworkDetailStats.IncrementStat(
UnityEditor.NetworkDetailStats.NetworkDirection.Outgoing,
(short)MsgType.Rpc, rpcName, 1);
#endif
}