Esempio n. 1
0
        /// <summary>
        /// 初始化所有的可出售卡片信息
        /// </summary>
        void InitHeroListCards()
        {
            List <int> mHeroList = MarketHeroListModel.Instance.GetHeroListTime(HeroType.AllHero);

            if (HeroTimeLimitList.Count != 0)
            {
                HeroTimeLimitList.Clear();
            }

            foreach (int hero in mHeroList)
            {
                ResourceItem objUnit = ResourcesManager.Instance.loadImmediate(GameConstDefine.LoadGameMarketHeroTag, ResourceType.PREFAB);
                GameObject   obj     = GameObject.Instantiate(objUnit.Asset) as GameObject;
                obj.transform.parent     = mGrid.transform;
                obj.transform.localScale = Vector3.one;
                obj.name = (HeroTimeLimitList.Count + 1).ToString();
                HeroCard card = new HeroCard();
                card.mRoot       = obj;
                card.mGoodsId    = hero;
                card.mSpriteIcon = obj.transform.Find("Portrait").GetComponent <UISprite>();
                Transform cost = obj.transform.Find("Cost");
                card.mDiamond_Common   = cost.Find("Crystal1").gameObject;
                card.mDiamond_DisCount = cost.Find("Crystal2").gameObject;
                card.mGold_Common      = cost.Find("Gold1").gameObject;
                card.mGold_DisCount    = cost.Find("Gold2").gameObject;
                card.mGoldLine         = cost.Find("Gold/Line");
                card.mCrystalLine      = cost.Find("Crystal/Line");
                card.IsOwn             = obj.transform.Find("IsOwn");
                card.mName             = obj.transform.Find("NamePlate/Name").GetComponent <UILabel>();
                card.TagList.Add(obj.transform.Find("Discount").gameObject);
                card.TagList.Add(obj.transform.Find("Hot").gameObject);
                card.TagList.Add(obj.transform.Find("New").gameObject);
                HeroTimeLimitList.Add(card);
            }
            if (HeroTimeLimitList.Count != 0)
            {
                UIGuideCtrl.Instance.AddUiGuideEventBtn(HeroTimeLimitList[0].mRoot);
            }
        }
Esempio n. 2
0
 //窗口控件释放
 protected override void RealseWidget()
 {
     HeroTimeLimitList.Clear();
 }