/**
         * RPC 受信関数.
         */


        private void Update()
        {
            now       = DateTime.Now;
            timeStamp = now.ToString("yyyy/MM/dd HH:mm:ss");
            logtime   = now.ToLongTimeString();

            //MUNサーバに接続している場合
            if (MonobitNetwork.isConnect)
            {
                // ルームに入室している場合
                if (MonobitNetwork.inRoom)
                {
                    roomName          = MonobitNetwork.room.name;
                    RoomNameText.text = "roomName : " + roomName;
                    PlayerList.text   = "PlayerList : ";


                    //Debug.Log("PlayerList:");
                    foreach (MonobitPlayer player in MonobitNetwork.playerList)
                    {
                        PlayerList.text = PlayerList.text + player.name + " ";
                    }


                    if (Mute)
                    {
                        List <MonobitPlayer> playerList = new List <MonobitPlayer>(vcPlayerInfo.Keys);
                        List <MonobitPlayer> vcTargets  = new List <MonobitPlayer>();
                        foreach (MonobitPlayer player in playerList)
                        {
                            vcPlayerInfo[player] = (Int32)EnableVC.DISABLE;
                            Debug.Log("vcPlayerInfo[" + player + "] = " + vcPlayerInfo[player]);
                            Debug.Log(player.ToString());

                            // ボイスチャットの送信可のプレイヤー情報を登録する
                            if (vcPlayerInfo[player] == (Int32)EnableVC.ENABLE)
                            {
                                vcTargets.Add(player);
                            }
                        }
                        // ボイスチャットの送信可否設定を反映させる
                        myVoice.SetMulticastTarget(vcTargets.ToArray());
                    }
                }
            }
        }
        /**
         * GUI制御.
         */
        void OnGUI()
        {
            // GUI用の解像度を調整する
            Vector2 guiScreenSize = new Vector2(800, 480);

            if (Screen.width > Screen.height)
            {
                // landscape
                GUIUtility.ScaleAroundPivot(new Vector2(Screen.width / guiScreenSize.x, Screen.height / guiScreenSize.y), Vector2.zero);
            }
            else
            {
                // portrait
                GUIUtility.ScaleAroundPivot(new Vector2(Screen.width / guiScreenSize.y, Screen.height / guiScreenSize.x), Vector2.zero);
            }

            // MUNサーバに接続している場合
            if (MonobitNetwork.isConnect)
            {
                // ルームに入室している場合
                if (MonobitNetwork.inRoom)
                {
                    // ルーム内のプレイヤー一覧の表示
                    GUILayout.BeginHorizontal();
                    GUILayout.Label("PlayerList : ");
                    foreach (MonobitPlayer player in MonobitNetwork.playerList)
                    {
                        GUILayout.Label(player.name + " ");
                    }
                    GUILayout.EndHorizontal();

                    // ルームからの退室
                    if (GUILayout.Button("Leave Room", GUILayout.Width(150)))
                    {
                        MonobitNetwork.LeaveRoom();
                    }

                    if (myVoice != null)
                    {
                        // 送信タイプの設定
                        GUILayout.BeginHorizontal();
                        GUILayout.Label("VoiceChat Send Type : ");
                        Int32 streamType = myVoice.SendStreamType == StreamType.BROADCAST ? 0 : 1;
                        myVoice.SendStreamType = (StreamType)GUILayout.Toolbar(streamType, new string[] { "broadcast", "multicast" });
                        GUILayout.EndHorizontal();

                        // マルチキャスト送信の場合の、ボイスチャットの送信可否設定
                        if (myVoice.SendStreamType == StreamType.MULTICAST)
                        {
                            List <MonobitPlayer> playerList = new List <MonobitPlayer>(vcPlayerInfo.Keys);
                            List <MonobitPlayer> vcTargets  = new List <MonobitPlayer>();
                            foreach (MonobitPlayer player in playerList)
                            {
                                // GUI による送信可否の切替
                                GUILayout.BeginHorizontal();
                                GUILayout.Label("PlayerName : " + player.name + " ");
                                GUILayout.Label("Send Permission: ");
                                vcPlayerInfo[player] = GUILayout.Toolbar(vcPlayerInfo[player], new string[] { "Allow", "Deny" });
                                GUILayout.EndHorizontal();
                                // ボイスチャットの送信可のプレイヤー情報を登録する
                                if (vcPlayerInfo[player] == (Int32)EnableVC.ENABLE)
                                {
                                    vcTargets.Add(player);
                                }
                            }

                            // ボイスチャットの送信可否設定を反映させる
                            myVoice.SetMulticastTarget(vcTargets.ToArray());
                        }
                    }
                }
                // ルームに入室していない場合
                else
                {
                    // ルーム名の入力
                    GUILayout.BeginHorizontal();
                    GUILayout.Label("RoomName : ");
                    roomName = GUILayout.TextField(roomName, GUILayout.Width(200));
                    GUILayout.EndHorizontal();

                    // ルームを作成して入室する
                    if (GUILayout.Button("Create Room", GUILayout.Width(150)))
                    {
                        MonobitNetwork.CreateRoom(roomName);
                    }

                    // ルーム一覧を検索
                    foreach (RoomData room in MonobitNetwork.GetRoomData())
                    {
                        // ルームを選択して入室する
                        if (GUILayout.Button("Enter Room : " + room.name + "(" + room.playerCount + "/" + ((room.maxPlayers == 0) ? "-" : room.maxPlayers.ToString()) + ")"))
                        {
                            MonobitNetwork.JoinRoom(room.name);
                        }
                    }
                }
            }
            // MUNサーバに接続していない場合
            else
            {
                // プレイヤー名の入力
                GUILayout.BeginHorizontal();
                GUILayout.Label("PlayerName : ");
                MonobitNetwork.playerName = GUILayout.TextField((MonobitNetwork.playerName == null) ? "" : MonobitNetwork.playerName, GUILayout.Width(200));
                GUILayout.EndHorizontal();

                // デフォルトロビーへの自動入室を許可する
                MonobitNetwork.autoJoinLobby = true;

                // MUNサーバに接続する
                if (GUILayout.Button("Connect Server", GUILayout.Width(150)))
                {
                    MonobitNetwork.ConnectServer("SimpleVoiceChat_v1.0");
                }
            }
        }