Esempio n. 1
0
    public ReloadingVO GetData(int itemId, ReloadingListState state)
    {
        ReloadingVO vo = null;

        switch (state)
        {
        case ReloadingListState.Clothing:
            foreach (var t in _cloths)
            {
                if (t.ItemId == itemId)
                {
                    vo = t;
                    break;
                }
            }
            break;

        case ReloadingListState.Backgroud:
            foreach (var t in _backgrounds)
            {
                if (t.ItemId == itemId)
                {
                    vo = t;
                    break;
                }
            }
            break;
        }

        return(vo);
    }
Esempio n. 2
0
    public void UpdateListItemRedFrameShow(int itemId, ReloadingListState state)
    {
        switch (state)
        {
        case ReloadingListState.Clothing:
            foreach (var item in _cloths)
            {
                item.IsPitchOn = item.ItemId == itemId;
                if (item.ItemId == itemId && item.IsGet)
                {
                    var key = GlobalData.PlayerModel.PlayerVo.UserId.ToString() + item.ItemId;
                    PlayerPrefs.SetInt(key, 1);
                    item.IsShowRedDot = false;
                }
            }
            break;

        case ReloadingListState.Backgroud:
            foreach (var item in _backgrounds)
            {
                item.IsPitchOn = item.ItemId == itemId;
                if (item.ItemId == itemId && item.IsGet)
                {
                    var key = GlobalData.PlayerModel.PlayerVo.UserId.ToString() + item.ItemId;
                    PlayerPrefs.SetInt(key, 1);
                    item.IsShowRedDot = false;
                }
            }
            break;
        }
    }
Esempio n. 3
0
 public List <ReloadingVO> GetList(ReloadingListState state)
 {
     if (state == ReloadingListState.Clothing)
     {
         return(_cloths);
     }
     else
     {
         return(_backgrounds);
     }
 }
Esempio n. 4
0
    public void RefreshRedFrameShow(List <ReloadingVO> list, ReloadingListState state)
    {
        switch (state)
        {
        case ReloadingListState.Clothing:
            for (int i = 0; i < _clothParent.childCount; i++)
            {
                _clothParent.GetChild(i).GetComponent <ReloadingItem>().SetData(list[i]);
            }
            break;

        case ReloadingListState.Backgroud:
            for (int i = 0; i < _backgroundParent.childCount; i++)
            {
                _backgroundParent.GetChild(i).GetComponent <ReloadingItem>().SetData(list[i]);
            }
            break;
        }
    }