Пример #1
0
 public bool SetGachaHistoryData(Json_GachaHistoryLog historys)
 {
     if (historys == null)
     {
         this.Cauntion.SetActive(true);
         ((Component)((Component)this.TitleText).get_transform().get_parent()).get_gameObject().SetActive(false);
         return(false);
     }
     this.mTitleName      = historys.title;
     this.mDropAt         = historys.drop_at;
     this.mLocalisedTitle = historys.multi_title;
     if (historys.drops != null && historys.drops.Length > 0)
     {
         this.mHistorys = new GachaHistoryData[historys.drops.Length];
         for (int index = 0; index < historys.drops.Length; ++index)
         {
             GachaHistoryData gachaHistoryData = new GachaHistoryData();
             if (gachaHistoryData.Deserialize(historys.drops[index]))
             {
                 this.mHistorys[index] = gachaHistoryData;
             }
         }
     }
     this.IsDataSet = true;
     return(true);
 }
Пример #2
0
        public bool SetGachaHistoryData(Json_GachaHistoryLog historys)
        {
            if (historys == null)
            {
                this.Cauntion.SetActive(true);
                ((Component)((Component)this.TitleText).get_transform().get_parent()).get_gameObject().SetActive(false);
                return(false);
            }
            this.mTitleName      = historys.title;
            this.mDropAt         = historys.drop_at;
            this.mLocalisedTitle = historys.multi_title;
            List <GachaHistoryData> source = new List <GachaHistoryData>();

            if (historys.drops != null && historys.drops.Length > 0)
            {
                for (int index = 0; index < historys.drops.Length; ++index)
                {
                    GachaHistoryData gachaHistoryData = new GachaHistoryData();
                    if (gachaHistoryData.Deserialize(historys.drops[index]))
                    {
                        source.Add(gachaHistoryData);
                    }
                }
            }
            if (historys.drops != null && historys.drops.Length > 0)
            {
                this.mHistorySets.Clear();
                this.mCacheHistorys.Clear();
                int num = Mathf.Max(1, historys.drops.Length / GachaHistoryWindow.NODE_VIEW_MAX);
                for (int index = 0; index < num; ++index)
                {
                    this.mCacheHistorys.Clear();
                    this.mCacheHistorys.AddRange(source.Skip <GachaHistoryData>(index * GachaHistoryWindow.NODE_VIEW_MAX).Take <GachaHistoryData>(GachaHistoryWindow.NODE_VIEW_MAX));
                    if (this.mCacheHistorys != null && this.mCacheHistorys.Count > 0)
                    {
                        this.mHistorySets.Add(this.mCacheHistorys.ToArray());
                    }
                }
            }
            this.IsDataSet = true;
            return(true);
        }