private List <PictureData> ParseGiftCodeContent(BonusCodeResponse response) { List <PictureData> list = new List <PictureData>(); if (response.content != null) { for (int i = 0; i < response.content.Length; i++) { WebPicData webPic = response.content[i]; PictureData pictureData = this.ParseWebPic(webPic, response.paths, null, true); if (pictureData != null) { list.Add(pictureData); } } } return(list); }
private void OnBonusCodeLoaded(bool success, string text) { if (this.bonusCodeCallback == null) { return; } if (success && !string.IsNullOrEmpty(text)) { BonusCodeResponse bonusCodeResponse = null; try { bonusCodeResponse = JsonUtility.FromJson <BonusCodeResponse>(text); FMLogger.vCore("gift code resp: " + text); } catch (Exception ex) { UnityEngine.Debug.LogError("gift code ex: " + ex.Message); UnityEngine.Debug.LogError("gift code failed to parse page responce"); UnityEngine.Debug.LogError(text); this.bonusCodeCallback(null); } if (bonusCodeResponse != null && bonusCodeResponse.IsValid()) { this.bonusCodeCallback(bonusCodeResponse); } else { UnityEngine.Debug.LogError("gc resp not valid: " + text); this.bonusCodeCallback(null); } } else { this.bonusCodeCallback(null); } this.bonusCodeCallback = null; }