| using System.Collections;  | 
| using System.Collections.Generic;  | 
| using UnityEngine;  | 
| namespace vnxbqy.UI  | 
| {  | 
|     public class OSRedEnvelopeCell : CellView  | 
|     {  | 
|         [SerializeField] RedPackBehaviour[] m_RedEnvelopes;  | 
|   | 
|         OSRedEnvelopeModel model  | 
|         {  | 
|             get { return ModelCenter.Instance.GetModel<OSRedEnvelopeModel>(); }  | 
|         }  | 
|   | 
|         FestivalRedpackModel festivalRedpackModel  | 
|         {  | 
|             get { return ModelCenter.Instance.GetModel<FestivalRedpackModel>(); }  | 
|         }  | 
|   | 
|         public void Display(int _line)  | 
|         {  | 
|             for (int i = 0; i < m_RedEnvelopes.Length; i++)  | 
|             {  | 
|                 var _index = _line * 5 + i;  | 
|                 m_RedEnvelopes[i].SetActive(_index < model.m_OSRedEnvelopes.Count);  | 
|                 if (_index < model.m_OSRedEnvelopes.Count)  | 
|                 {  | 
|                     m_RedEnvelopes[i].Init(model.m_OSRedEnvelopes[_index]);  | 
|                 }  | 
|             }  | 
|         }  | 
|   | 
|         public void DisplayFestivalRedpacks(int _line)  | 
|         {  | 
|             for (int i = 0; i < m_RedEnvelopes.Length; i++)  | 
|             {  | 
|                 var _index = _line * 5 + i;  | 
|                 m_RedEnvelopes[i].SetActive(_index < festivalRedpackModel.taskDisplayRedpacks.Count);  | 
|                 if (_index < festivalRedpackModel.taskDisplayRedpacks.Count)  | 
|                 {  | 
|                     m_RedEnvelopes[i].Init(festivalRedpackModel.taskDisplayRedpacks[_index]);  | 
|                 }  | 
|             }  | 
|         }  | 
|     }  | 
| }  | 
|   |