コード例 #1
0
    void RpcTargetBroadcastPlayerInput(int[] data, NetworkMessageInfo info)
    {
        LogPing(info);

        // Get new commands
        IEnumerable <Command> commands = CommandPacker.Unpack(data);

        // Add commands to queue
        foreach (var command in commands)
        {
            _messageQueue.Enqueue(new KeyValuePair <string, Command>(info.sender.guid, command));
        }
    }
コード例 #2
0
 public void BroadcastPlayerInput(IEnumerable <Command> commands)
 {
     GetComponent <NetworkView>().RPC("RpcTargetBroadcastPlayerInput", RPCMode.Server, CommandPacker.Pack(commands));
 }