public override void read(ErlKVMessage message) { ErlArray str = message.getValue("msg") as ErlArray; if (str != null) { ArenaGuessUser[] users = new ArenaGuessUser[2]; for (int i = 0; i < 2; i++) { ErlArray arr = str.Value[i] as ErlArray; if (arr != null) { int pos = 0; ArenaGuessUser user = new ArenaGuessUser(); user.uid = arr.Value[pos++].getValueString(); user.name = arr.Value[pos++].getValueString(); user.headIcon = StringKit.toInt(arr.Value[pos++].getValueString()); user.level = StringKit.toInt(arr.Value[pos++].getValueString()); user.guild = arr.Value[pos++].getValueString(); user.select = bool.Parse(arr.Value[pos++].getValueString()); users[i] = user; } } if (callback != null) { callback(users); } } }
void OnDataLoad(ArenaGuessUser[] users) { this.users = users; for (int i = 0; i < 2; i++) { item [i].SetActive(users [i] != null); if (users [i] != null) { ArenaGuessUser u = users [i]; ResourcesManager.Instance.LoadAssetBundleTexture(UserManager.Instance.getIconPath(u.headIcon), texIcon [i]); lblName [i].text = u.name; if (u.guild != "none") { lblGuild [i].text = u.guild; } else { lblGuild [i].text = ""; } lblLevel [i].text = "LV." + u.level; select [i].SetActive(u.select); button [i].SetActive(!u.select); } } }