//void OnPhotonPlayerDisconnected(PhotonPlayer player) //玩家断开连接 //{ // print("断开连接{"); // int color = 0; // string str = player.AllProperties["color"].ToString(); // if(str.Equals("red")) // { // color = red; // } // else if (str.Equals("yellow")) // { // color = yellow; // } // else if (str.Equals("blue")) // { // color = blue; // } // else if (str.Equals("green")) // { // color = green; // } // if (myBlokusController.loseCount < 3) // { // if (myBlokusController.loseColor[color] == 0) // { // myBlokusController.lose(color); // } // } // ShowMessage(str+"方已离开游戏"); // print("}断开连接"); //} public void InitBlokusRoomUIInfo(BLOKUSRoomPlayerList info) //初始化房间信息 { BlokusRoomName.text = GameCache.roomName; BlokusYourName.text = GameCache.account; playerOneName.text = ""; playerTwoName.text = ""; playerThreeName.text = ""; playerFourName.text = ""; playerOneChoice.text = ""; playerTwoChoice.text = ""; playerThreeChoice.text = ""; playerFourChoice.text = ""; List <BLOKUSRoomPlayerInfo> playerInfos = info.itmes; for (int i = 0; i < playerInfos.Count; i++) { BLOKUSRoomPlayerInfo playerInfo = playerInfos[i]; if (playerInfo.account.Equals(GameCache.account)) { GameCache.myColor = playerInfo.color; } switch (i) { case 0: { playerOneName.text = playerInfo.account; playerOneChoice.text = Color.getColorText(playerInfo.color); break; } case 1: { playerTwoName.text = playerInfo.account; playerTwoChoice.text = Color.getColorText(playerInfo.color); break; } case 2: { playerThreeName.text = playerInfo.account; playerThreeChoice.text = Color.getColorText(playerInfo.color); break; } case 3: { playerFourName.text = playerInfo.account; playerFourChoice.text = Color.getColorText(playerInfo.color); break; } } } }
//public void OnBlokusReady() //{ // Application.LoadLevelAdditive("Blokus"); // UIControl.PanelChange(myUIControl.BlokusRoom); //} //[PunRPC] public void updateRoomPlayersInfo(BLOKUSRoomPlayerList info) { BlokusRoomName.text = GameCache.roomName; BlokusYourName.text = GameCache.account; playerOneName.text = ""; playerTwoName.text = ""; playerThreeName.text = ""; playerFourName.text = ""; playerOneChoice.text = ""; playerTwoChoice.text = ""; playerThreeChoice.text = ""; playerFourChoice.text = ""; playerOneReady.text = ""; playerTwoReady.text = ""; playerThreeReady.text = ""; playerFourReady.text = ""; //PhotonPlayer[] players = PhotonNetwork.playerList; List <BLOKUSRoomPlayerInfo> playerInfos = info.itmes; for (int i = 0; i < playerInfos.Count; i++) { //ExitGames.Client.Photon.Hashtable ht = p.AllProperties; BLOKUSRoomPlayerInfo playerInfo = playerInfos[i]; if (playerInfo.account.Equals(GameCache.account)) { GameCache.myColor = playerInfo.color; } switch (i) { case 0: { playerOneName.text = playerInfo.account; playerOneChoice.text = Color.getColorText(playerInfo.color); playerOneReady.text = getReadyText(playerInfo.isReady); break; } case 1: { playerTwoName.text = playerInfo.account; playerTwoChoice.text = Color.getColorText(playerInfo.color); playerTwoReady.text = getReadyText(playerInfo.isReady); break; } case 2: { playerThreeName.text = playerInfo.account; playerThreeChoice.text = Color.getColorText(playerInfo.color); playerThreeReady.text = getReadyText(playerInfo.isReady); break; } case 3: { playerFourName.text = playerInfo.account; playerFourChoice.text = Color.getColorText(playerInfo.color); playerFourReady.text = getReadyText(playerInfo.isReady); break; } } } }