示例#1
0
        public void SetData(PrizeChestWndView wndView, int index, int nPrizeID, SSchemeActorPrizeConfig config)
        {
            if (config == null ||  wndView == null)
            {
                return;
            }

            m_wndView        = wndView;
            m_Index          = index;
            actorPrizeConfig = config;

            prizeName.text = config.strPrizeName;
            //prizeGradeImage.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_PrizeChest, "PrizeBase" + config.nPrizeGrade, WndID.WND_ID_PRIZECHEST);
            prizeIconImage.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_PrizeChest, "PrizeIconFrame" + config.nPrizeGrade, WndID.WND_ID_PRIZECHEST);
            prizeTypeImage.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_PrizeChest, "PrizeType" + config.nPrizeType, WndID.WND_ID_PRIZECHEST);
            //prizeTypeImage.SetNativeSize();

            prizeIcon = LogicDataCenter.pointShopDataManager.CreatePrizeIconItem(prizeIconContainer);
            prizeIcon.SetPrizeID(nPrizeID);

            TimerManager.SetTimer(this, (int)EMPrizeResultTimerType.EMTimer_ResultCreatEffect, 4.3f);
            prizeChestClickBtn.onClick.RemoveAllListeners();
            prizeChestClickBtn.onClick.AddListener(ShowDetailInfo);
            prizeChestClickBtn.interactable = true;
            DetailFrame.SetActive(false);
        }
示例#2
0
        public PrizeIconItem CreatePrizeIconItem(Transform iconContainer)
        {
            GameObject    newItem = prizeIconItemRes.InstanceMainRes();
            PrizeIconItem result  = null;

            if (newItem)
            {
                result = newItem.GetComponent <PrizeIconItem>();
                if (result)
                {
                    result.SetContainer(iconContainer as RectTransform);
                }
                else
                {
                    prizeIconItemRes.DestroyInstanceRes(ref newItem);
                }
            }

            return(result);
        }