private void Awake() { map = SetMapController.GetMap(); maps[map].SetActive(true); wins = SetWinsController.GetWins(); targetScore.text = wins.ToString(); playerOneScore = 0; playerTwoScore = 0; playerOneScoreText.text = "0"; playerTwoScoreText.text = "0"; onPlayerDeath += PlayerDeathEvent; }
public override void OnJoinedRoom() { if (PhotonNetwork.IsMasterClient) { playerOneName.text = PhotonNetwork.PlayerList[0].NickName; playerTwoName.text = ""; toSkillSelectionButton.GetComponent <Button>().interactable = false; } else { playerOneName.text = PhotonNetwork.PlayerList[0].NickName; playerTwoName.text = PhotonNetwork.PlayerList[1].NickName; SetMapController.SetMap((int)PhotonNetwork.CurrentRoom.CustomProperties["map"]); SetWinsController.SetWins((int)PhotonNetwork.CurrentRoom.CustomProperties["wins"]); toSkillSelectionButton.SetActive(false); } panelsController.SetPanelActive("Room Panel"); }
public void OnCreateRoomButtonClicked() { string roomName = PlayerPrefs.GetString("Nickname", "") + "'s room"; var roomOptions = new RoomOptions(); Hashtable properties = new Hashtable() { { "wins", SetWinsController.GetWins() }, { "map", SetMapController.GetMap() } }; roomOptions.CustomRoomProperties = properties; roomOptions.CustomRoomPropertiesForLobby = new string[] { "wins", "map" }; roomOptions.MaxPlayers = 2; PhotonNetwork.CreateRoom(roomName, roomOptions, TypedLobby.Default); }