public void PlayerScored() { var player = PhotonNetwork.LocalPlayer; var score = 1; var team = CustomPlayerProperties.GetTeam(player); CustomPlayerProperties.AddScore(player, score); CustomRoomProperties.AddScore(PhotonNetwork.CurrentRoom, team, score); }
protected override void ResetGame() { InputBridgeBase.ToggleMovement(false); CustomPlayerProperties.ResetProps(PhotonNetwork.LocalPlayer); if (PhotonNetwork.IsMasterClient) { CustomRoomProperties.InitializeRoom(PhotonNetwork.CurrentRoom, PhotonNetwork.CurrentRoom.PlayerCount); } }
public static int GetNextTeam() { int[] _teamSizes = CustomRoomProperties.GetTeams(PhotonNetwork.CurrentRoom); int _team = 0; int _min = _teamSizes[0]; for (int i = 0; i < _teamSizes.Length; i++) { if (_teamSizes[i] < _min) { _min = _teamSizes[i]; _team = i; } } return(_team); }
private IEnumerator StartGameCountdown() { yield return(new WaitForSeconds(startDelay)); CustomRoomProperties.SetGameState(PhotonNetwork.CurrentRoom, 2); }