public void SetData(ActivityCapsuleTemplateModel model)
    {
        //Debug.Log("draw view setdata");
        for (int i = 0; i < _drawPool.Length; ++i)
        {
            if (i >= model.capsuleItemIds.Count)
            {
                continue;
            }
            int id = model.capsuleItemIds[i];
            ActivityCapsuleItemPB awardData = model.GetCapsuleItem(model.capsuleItemIds[i]);
            _drawPool[i].id = id;
            //Debug.Log("capsuleItem id:"+id);
            _drawPool[i].SetData(awardData, model);
        }
        _disableIds = model.gainCapsuleItems;


        if (model.costItem != null)
        {
            _haveNumIcon.texture = PropUtils.GetPropIcon(model.costItem.ResourceId);
            _haveNumIcon.color   = Color.white;
            _haveNumText.text    = PropUtils.GetUserPropNum(model.costItem.ResourceId).ToString();

            _costNumIcon.texture = PropUtils.GetPropIcon(model.costItem.ResourceId);
            _costNumIcon.color   = Color.white;
            _costNumText.text    = "x" + model.costItem.Num;
        }
    }
예제 #2
0
    public void RefreshNum(ActivityCapsuleTemplateModel model)
    {
        if (model.costItem != null)
        {
            _costIcon.texture = PropUtils.GetPropIcon(model.costItem.ResourceId);
            _costIcon.color   = Color.white;
            int num = PropUtils.GetUserPropNum(model.costItem.ResourceId);
            //Debug.LogError("num====?"+num);
            _costNumText.text = num.ToString();

            bool capsuleState = false;
            if (num >= model.costItem.Num && !model.GainAllCapsuleItem())
            {
                capsuleState = true;
            }
            _lotteryRedPoint.SetActive(capsuleState);
        }
        _uiEffectObj.SetActive(true);
    }
예제 #3
0
    public void SetData(ActivityCapsuleTemplateModel model)
    {
        //Debug.LogWarning("view  setData:" + model.GainAllCapsuleItem());
        if (model.costItem != null)
        {
            _costIcon.texture = PropUtils.GetPropIcon(model.costItem.ResourceId);
            _costIcon.color   = Color.white;
            int num = PropUtils.GetUserPropNum(model.costItem.ResourceId);
            _costNumText.text = num.ToString();

            bool capsuleState = false;
            if (num >= model.costItem.Num && !model.GainAllCapsuleItem())
            {
                capsuleState = true;
            }
            _lotteryRedPoint.SetActive(capsuleState);
        }
        _endTimeStamp = model.EndTimeStamp;
        SetActivityTime();

        _storyRedPoint.SetActive(model.HaveCanReadStory());

        _uiEffectObj.SetActive(true);
    }