public void SetPlayerInfo(PlayerInfo pInfo) { this.info = pInfo; this.transform.position = new Vector3(pInfo.positionX, pInfo.positionY, 0f); SetPlayerName(pInfo.playerName, pInfo.isImpostor); SetPlayerColor(ColorCodeConverter.ColorFromCode(pInfo.colorCode)); }
public void UpdateRoomInfo(PlayerInfo[] pInfo) { for (int i = 0; i < playerInfoRows.Length; i++) { if (pInfo.Length - 1 >= i) { Color col = ColorCodeConverter.ColorFromCode(pInfo[i].colorCode); if (i == GameInfoHolder.gihInstance.mainPlayerIndex) { mainImageColorChange.SetColor(col); } playerInfoRows[i].gameObject.SetActive(true); playerInfoRows[i].playerName.text = pInfo[i].playerName; playerInfoRows[i].colorChanger.SetColor(col); } else { playerInfoRows[i].gameObject.SetActive(false); } } }