public void SelectTeamPlayerT(NetworkIdentity client) { if (teamT.Count == maxPlayerInTeam) { RpcMessageError(client); return; } PlayerTeamController player = client.GetComponent <PlayerTeamController>(); if (player.team == PlayerTeamController.TypeTeam.T) { return; } else if (player.team == PlayerTeamController.TypeTeam.None) { player.team = PlayerTeamController.TypeTeam.T; teamT.Add(client); } else { teamCT.Remove(client); player.team = PlayerTeamController.TypeTeam.T; } //ВЫБОР СКИНА ДЛЯ ИГРОКА //int n = Random.Range(0, dataPlayerCombatT.Count); //client.GetComponent<PlayerCombatController>().SetDataPlayerCombat = dataPlayerCombatT[n];2; SelectDataPlayerCombat(client, 1); //КОНЕЦ ВЫБОРА СКИНА ДЛЯ ИГРОКА player.StatusSelectTeam(client.connectionToClient, true); player.transform.position = spawnPositionT[0].position; //Спавн игрока RpcNewPositionPlayer(client, spawnPositionT[0].position); }
public void SelectTeamPlayerCT(NetworkIdentity client) { if (teamCT.Count == maxPlayerInTeam) { RpcMessageError(client); return; } PlayerTeamController player = client.GetComponent <PlayerTeamController>(); if (player.team == PlayerTeamController.TypeTeam.CT) { return; } else if (player.team == PlayerTeamController.TypeTeam.None) { player.team = PlayerTeamController.TypeTeam.CT; teamCT.Add(client); } else { teamT.Remove(client); player.team = PlayerTeamController.TypeTeam.CT; } SelectDataPlayerCombat(client, 0); client.GetComponent <PlayerCombatController>().idSkinNow = 0; client.GetComponent <PlayerCombatController>().idSkin = 0; player.StatusSelectTeam(client.connectionToClient, true); player.transform.position = spawnPositionCT[0].position; //Спавн игрока RpcNewPositionPlayer(client, spawnPositionCT[0].position); }
public void RpcMessageError(NetworkIdentity client) { PlayerTeamController player = client.GetComponent <PlayerTeamController>(); player.StatusSelectTeam(client.connectionToClient, false); }