public void Refresh() { if (!gameObject.activeInHierarchy) { needsToRefresh = true; return; } needsToRefresh = false; transform.SetParent( ServerController.GetObjectFromTeam <GameObject>( player.GetTeam(), scoreboard.redTeamGroup, scoreboard.blueTeamGroup, scoreboard.noneTeamGroup ).transform ); transform.localScale = Vector3.one; back.color = PhotonNetwork.player == player ? ownerColor : defaultColor; usernameText.text = player.NickName; int wins = ServerController.GetPoints(player); int kills = ServerController.GetKills(player); int deaths = ServerController.GetDeaths(player); scoreText.text = string.Format("{0}/{1}/{2}", kills, deaths, wins); }
public void Set(PhotonPlayer dead, string customReason) { killerText.gameObject.SetActive(false); weaponIcon.gameObject.SetActive(false); customReasonText.gameObject.SetActive(true); headshotIcon.SetActive(false); customReasonText.text = customReason; deadText.text = dead.NickName; deadText.color = ServerController.GetObjectFromTeam <Color>(dead.GetTeam(), redTeamColor, blueTeamColor, noneTeamColor); }
public void Set(PhotonPlayer killer, GunInfo gun, PhotonPlayer dead, bool headshot) { killerText.gameObject.SetActive(true); weaponIcon.gameObject.SetActive(true); customReasonText.gameObject.SetActive(false); headshotIcon.SetActive(headshot); killerText.text = killer.NickName; killerText.color = ServerController.GetObjectFromTeam <Color>(killer.GetTeam(), redTeamColor, blueTeamColor, noneTeamColor); float ratio = gun.sprite.rect.width / gun.sprite.rect.height; weaponIcon.sprite = gun.sprite; weaponLayoutElement.preferredWidth = weaponLayoutElement.preferredHeight * ratio; deadText.text = dead.NickName; deadText.color = ServerController.GetObjectFromTeam <Color>(dead.GetTeam(), redTeamColor, blueTeamColor, noneTeamColor); }
public void Set(PhotonPlayer player, string message) { string color = ServerController.GetObjectFromTeam <string>(player.GetTeam(), redTeamColor, blueTeamColor, noneTeamColor); text.text = string.Format(chatFormat, player.NickName, message, color); }
void OnValidate() { rend.material = ServerController.GetObjectFromTeam <Material>(team, redTeam, blueTeam, noneTeam); gameObject.name = string.Format("Spawnpoint ({0})", ServerController.GetObjectFromTeam <string>(team, "Red", "Blue", "None")); }
void Start() { PunTeams.Team team = PhotonView.Get(transform.root.gameObject).owner.GetTeam(); renderer.material = ServerController.GetObjectFromTeam <Material>(team, redTeamMaterial, blueTeamMaterial, noneTeamMaterial); }