public static void FireRegisteredPlayersInfoReceived(API_TournamentRegPlayers regPlayers) { if (registeredPlayerInfoReceived != null) { registeredPlayerInfoReceived(regPlayers); } }
private void HandleRegisteredPlayersInfoReceived(API_TournamentRegPlayers regPlayers) { if (gameID.Equals(regPlayers.id)) { loader.gameObject.SetActive(false); if (regPlayers.playerList.Count == 0) { txtMessage.text = APIConstants.MESSAGE_TOUR_NO_REGD_PLAYERS; } else { regPlayerList = new List <GameObject> (); int i = 0; foreach (SingleGameInfoPlayer sgip in regPlayers.playerList) { GameObject obj = Instantiate(regPlayerPrefab) as GameObject; obj.transform.SetParent(scrollViewContent); obj.transform.localScale = Vector3.one; RegdPlayerObject rpo = obj.GetComponent <RegdPlayerObject> (); rpo.txtName.text = sgip.name; string buyIn = Utility.GetCommaSeperatedAmount(sgip.buy_in); if (isRealMoney) { buyIn = Utility.GetRealMoneyAmount(sgip.buy_in); } rpo.txtBuyin.text = buyIn; string balance = Utility.GetCommaSeperatedAmount(sgip.balance_chips); if (isRealMoney) { balance = Utility.GetRealMoneyAmount(sgip.balance_cash); } rpo.txtTotalChips.text = balance; rpo.DownloadCountryFlag(sgip.flagUrl); Color bgColor = new Color(); bgColor.a = ++i % 2 == 0 ? 0f : .25f; rpo.imgBackground.color = bgColor; regPlayerList.Add(obj); } SetContentHeight(regPlayers.playerList.Count); } } }
private void OnRegisteredPlayersInfoReceived(WWW www) { debugString += "\n" + www.text; if (www.error != null) { DebugLog.Log(www.error); return; } DebugLog.LogWarning(www.text); API_TournamentRegPlayers regPlayers = new API_TournamentRegPlayers(www.text); FireRegisteredPlayersInfoReceived(regPlayers); }