Exemple #1
0
    /// <summary>
    /// 创建商品列表
    /// </summary>
    /// <param name="listData"></param>
    public void CreateGroceryData(List <StoreInfoBean> listData)
    {
        CptUtil.RemoveChildsByActive(objGuidStoreContent.transform);
        if (listData == null || objGuidStoreContent == null)
        {
            return;
        }
        GameDataBean gameData = GameDataHandler.Instance.manager.GetGameData();

        for (int i = 0; i < listData.Count; i++)
        {
            StoreInfoBean itemData = listData[i];
            //检测是否满足前置成就
            if (!itemData.CheckPreAchIds(gameData))
            {
                continue;
            }
            GameObject itemObj = null;
            if (itemData.mark_type == 1)
            {
                itemObj = Instantiate(objGuidStoreContent, objGuidStoreForItemsModel);
                ItemTownStoreForGoodsCpt groceryCpt = itemObj.GetComponent <ItemTownStoreForGoodsCpt>();
                groceryCpt.SetData(itemData);
            }
            else if (itemData.mark_type == 2)
            {
                itemObj = Instantiate(objGuidStoreContent, objGuidStoreForBuildModel);
                ItemTownCerpenterCpt cerpenterCpt = itemObj.GetComponent <ItemTownCerpenterCpt>();
                cerpenterCpt.SetData(itemData);
            }
            itemObj.transform.DOScale(new Vector3(0, 0, 0), 0.5f).SetEase(Ease.OutBack).SetDelay(i * 0.05f).From();
        }
    }
Exemple #2
0
 /// <summary>
 /// 创建列表
 /// </summary>
 /// <param name="listData"></param>
 public void CreateItemsList(List <StoreInfoBean> listData)
 {
     CptUtil.RemoveChildsByActive(objItemsContainer);
     if (listData == null)
     {
         return;
     }
     foreach (StoreInfoBean storeInfo in listData)
     {
         GameObject objItem = Instantiate(objItemsContainer, objItemsModel);
         ItemTownStoreForGoodsCpt itemCpt = objItem.GetComponent <ItemTownStoreForGoodsCpt>();
         itemCpt.SetData(storeInfo);
     }
 }
Exemple #3
0
 /// <summary>
 /// 创建商品列表
 /// </summary>
 /// <param name="listData"></param>
 public void CreateClothesData(List <StoreInfoBean> listData)
 {
     CptUtil.RemoveChildsByActive(objGroceryContent.transform);
     if (listData == null || objGroceryContent == null || objGroceryModel == null)
     {
         return;
     }
     for (int i = 0; i < listData.Count; i++)
     {
         StoreInfoBean            itemData = listData[i];
         GameObject               itemObj  = Instantiate(objGroceryContent, objGroceryModel);
         ItemTownStoreForGoodsCpt goodsCpt = itemObj.GetComponent <ItemTownStoreForGoodsCpt>();
         goodsCpt.SetData(itemData);
     }
 }
Exemple #4
0
 /// <summary>
 /// 创建商品列表
 /// </summary>
 /// <param name="listData"></param>
 public void CreateGroceryData(List <StoreInfoBean> listData)
 {
     CptUtil.RemoveChildsByActive(objGroceryContent.transform);
     if (listData == null || objGroceryContent == null || objGroceryModel == null)
     {
         return;
     }
     for (int i = 0; i < listData.Count; i++)
     {
         StoreInfoBean            itemData = listData[i];
         GameObject               itemObj  = Instantiate(objGroceryContent, objGroceryModel);
         ItemTownStoreForGoodsCpt goodsCpt = itemObj.GetComponent <ItemTownStoreForGoodsCpt>();
         goodsCpt.SetData(itemData);
         itemObj.transform.DOScale(new Vector3(0, 0, 0), 0.5f).SetEase(Ease.OutBack).From();
     }
 }
Exemple #5
0
    /// <summary>
    /// 创建商品ITEM
    /// </summary>
    /// <param name="storeInfo"></param>
    public void CreateArenaGoodsItem(StoreInfoBean storeInfo)
    {
        GameObject objItem = null;

        if (storeInfo.mark_type == 1)
        {
            objItem = Instantiate(objGoodsContainer, objGoodsForItemsModel);
            ItemTownStoreForGoodsCpt goodsItem = objItem.GetComponent <ItemTownStoreForGoodsCpt>();
            goodsItem.SetData(storeInfo);
        }
        else if (storeInfo.mark_type == 2)
        {
            objItem = Instantiate(objGoodsContainer, objGoodsForBuildModel);
            ItemTownCerpenterCpt cerpenterCpt = objItem.GetComponent <ItemTownCerpenterCpt>();
            cerpenterCpt.SetData(storeInfo);
        }
        objItem.transform.DOScale(new Vector3(0, 0, 0), 0.5f).SetEase(Ease.OutBack).From();
    }