public void GainPrizeSuccess(int targetID) { redPointImage.gameObject.SetActive(IsHavePrize()); DefaultPromotionPrizeItem prize = m_prizVeiwList.Find(item => item.m_targetID == targetID); prize.GainPrizeSuccess(); }
private bool InitTotalNumGamesFrame() { m_prizeFrameObj = totalNumberGamesObj.transform.FindChild("PrizeFrame").gameObject; totalNumGamesIF.text = LogicDataCenter.gamePromotionDataManager.TotalNumGames.ToString(); giftBtn.onClick.AddListener(OnGiftBtnClick); defaultPrizeItemObj.SetActive(false); defaultSubPrizeItemObj.SetActive(false); Transform parent = defaultPrizeItemObj.transform.parent; defaultPrizeItemObj.transform.SetParent(totalNumberGamesObj.transform); defaultSubPrizeItemObj.transform.SetParent(totalNumberGamesObj.transform); int count = RecommendPrizeConfig.Instance.ConfigList.Count; count = count > MAX_PRIZE_LEVEL_COUNT ? MAX_PRIZE_LEVEL_COUNT : count; for (int i = 0; i < count; ++i) { GameObject go = Instantiate(defaultPrizeItemObj.gameObject); if (go == null) { Trace.LogError("DefaultPromotionPrizeItem Instantiate failed"); return(false); } go.transform.SetParent(parent, false); go.SetActive(false); Transform subParent = go.transform.FindChild("Prize/PrizeContainer"); DefaultPromotionPrizeItem item = go.GetComponent <DefaultPromotionPrizeItem>(); if (!item.Init(this, subParent)) { return(false); } m_prizVeiwList.Add(item); } return(true); }