public static void FireSingleGameInfoReceived(API_SingleGameInfo gameInfo) { if (singleGameInfoReceived != null) { singleGameInfoReceived(gameInfo); } }
private void HandleSingleGameInfoReceived(API_SingleGameInfo singleGameInfo) { if (gameData.id.Equals(singleGameInfo.id)) { loader.gameObject.SetActive(false); if (singleGameInfo.users.Count > 0) { } else { txtMessage.text = APIConstants.MESSAGE_NO_PLAYERS_IN_GAME; } } }
private void HandleSingleGameInfoReceived(API_SingleGameInfo singleGameInfo) { if (gameData.id.Equals(singleGameInfo.id)) { loader.gameObject.SetActive(false); playersList = new List <GameObject> (); if (singleGameInfo.users.Count > 0) { int i = 0; foreach (SingleGameInfoPlayer pi in singleGameInfo.users) { GameObject obj = Instantiate(playerPrefab) as GameObject; obj.transform.SetParent(content); CashGamePlayerObject p = obj.GetComponent <CashGamePlayerObject> (); p.txtName.text = pi.name; if (gameData.money_type.Equals(APIConstants.KEY_REAL_MONEY)) { p.txtTotalChips.text = Utility.GetCommaSeperatedAmount(pi.balance_cash, true); p.txtBuyinAmount.text = Utility.GetCommaSeperatedAmount(pi.buy_in, true); } else { p.txtTotalChips.text = Utility.GetCommaSeperatedAmount(pi.balance_chips); p.txtBuyinAmount.text = Utility.GetCommaSeperatedAmount(pi.buy_in); } obj.transform.localScale = Vector3.one; Color bgColor = new Color(); // ColorUtility.TryParseHtmlString (i % 2 == 0 ? APIConstants.HEX_COLOR_GAME_LIST_ODD_ROW : APIConstants.HEX_COLOR_GAME_LIST_EVEN_ROW, out bgColor); bgColor.a = i % 2 == 0 ? 0f : .25f; p.imgBackground.color = bgColor; playersList.Add(obj); i++; } SetContentHeight(singleGameInfo.users.Count); } else { txtMessage.text = APIConstants.MESSAGE_NO_PLAYERS_IN_GAME; } } }