void UpdateTeamUi() { RoomInfo roomInfo = PhotonNetwork.CurrentRoom; CustomGameRoomData gameRoomData = CustomGameRoomData.GetCustomGameRoomData(roomInfo); if (gameRoomData._multiPlayMode == MultiPlayMode.Free) { _teamUi.SetActive(false); } else { _teamUi.SetActive(true); } }
public void UpdateContents(int index, RoomInfo roomInfo) { CustomGameRoomData gameRoomData = CustomGameRoomData.GetCustomGameRoomData(roomInfo); _index.text = (index + 1).ToString(); _mode.text = gameRoomData._multiPlayMode.ToString(); _roomName.text = roomInfo.Name; _creator.text = gameRoomData._roomCreator; _playersNumber.text = roomInfo.PlayerCount + "/" + roomInfo.MaxPlayers; _gameState.text = gameRoomData._roomState.ToString(); _lockUI.SetActive(gameRoomData._privateRoom); _curRoomInfo = roomInfo; }
public void UpdateRoomInfo(RoomInfo roomInfo, int playerCount) { _selectRoomUi.SetActive(true); _roomName.text = roomInfo.Name; CustomGameRoomData gameRoomData = CustomGameRoomData.GetCustomGameRoomData(roomInfo); _gameMode.text = gameRoomData._multiPlayMode.ToString(); _playerCount.text = playerCount + "/" + roomInfo.MaxPlayers; _togglePrivate.isOn = gameRoomData._privateRoom; _passwordWindow.SetActive(_togglePrivate.isOn); _targetPassword = gameRoomData._password; _uiCreatorName.text = gameRoomData._roomCreator; _roomState.text = gameRoomData._roomState.ToString(); _sceneName.text = gameRoomData._sceneName; }
void UpdatePlayersInfo() { for (int i = 0; i < playerList.Count; ++i) { playerList[i].GetComponent <PlayerHP>().UpdateHp(); } var gameRoomInfo = CustomGameRoomData.GetCustomGameRoomData(PhotonNetwork.CurrentRoom); for (int i = 0; i < playerList.Count; ++i) { if (playerList[i]._photonView.Owner == PhotonNetwork.LocalPlayer) { playerList[i].gameObject.layer = LayerMask.NameToLayer("TeamPlayer"); } else { if (gameRoomInfo._multiPlayMode == MultiPlayMode.Team) { if (playerList[i]._photonView.Owner.GetTeam() == PhotonNetwork.LocalPlayer.GetTeam()) { playerList[i].gameObject.layer = LayerMask.NameToLayer("TeamPlayer"); } else { playerList[i].gameObject.layer = LayerMask.NameToLayer("EnemyPlayer"); } } else { playerList[i].gameObject.layer = LayerMask.NameToLayer("EnemyPlayer"); } } } }
public bool IsSameScene() { var gameRoomInfo = CustomGameRoomData.GetCustomGameRoomData(PhotonNetwork.CurrentRoom); return(SceneManager.GetActiveScene().name == gameRoomInfo._sceneName); }