示例#1
0
 public void SetPlayerTeam(int teamInt)
 {
     if (PhotonNetwork.CurrentRoom.PlayerCount > 1)
     {
         var player = PhotonNetwork.CurrentRoom.GetPlayer(1);
         if (player.CustomProperties.ContainsKey(TEAM))
         {
             var occupiedTeam = player.CustomProperties[TEAM];
             teamInt = (int)occupiedTeam == 0 ? 1 : 0;
         }
     }
     PhotonNetwork.LocalPlayer.SetCustomProperties(new ExitGames.Client.Photon.Hashtable()
     {
         { TEAM, teamInt }
     });
     gameInitializer.InitializeMultiplayerController();
     chessGameController.SetupCamera((TeamColor)teamInt);
     chessGameController.SetLocalPlayer((TeamColor)teamInt);
     chessGameController.StartNewGame();
 }