Example #1
0
 public void SetData(List <UserInfiniteTowersBean> listData)
 {
     if (listInfiniteTowers == null)
     {
         listInfiniteTowers = new List <ItemGameMainHintForInfiniteTowersCpt>();
     }
     for (int f = 0; f < listData.Count; f++)
     {
         UserInfiniteTowersBean itemData = listData[f];
         bool hasData = false;
         for (int i = 0; i < listInfiniteTowers.Count; i++)
         {
             ItemGameMainHintForInfiniteTowersCpt itemCpt = listInfiniteTowers[i];
             if (itemCpt.infiniteTowersData == itemData)
             {
                 hasData = true;
                 itemCpt.RefreshData();
                 if (itemCpt.infiniteTowersData.proForSend == -1)
                 {
                     listInfiniteTowers.Remove(itemCpt);
                     Destroy(itemCpt.gameObject);
                     i--;
                 }
             }
         }
         if (!hasData)
         {
             CreateItemForInfiniteTowers(itemData);
         }
     }
     CheckHasData();
 }
Example #2
0
    /// <summary>
    /// 创建爬塔数据
    /// </summary>
    /// <param name="infiniteTowersData"></param>
    public void CreateItemForInfiniteTowers(UserInfiniteTowersBean infiniteTowersData)
    {
        GameObject objItem = Instantiate(objHintContainer, objInfiniteTowersModel);
        ItemGameMainHintForInfiniteTowersCpt itemCpt = objItem.GetComponent <ItemGameMainHintForInfiniteTowersCpt>();

        itemCpt.SetData(infiniteTowersData);
        listInfiniteTowers.Add(itemCpt);
    }
Example #3
0
 private void Update()
 {
     if (!CheckUtil.ListIsNull(listResearch) || !CheckUtil.ListIsNull(listInfiniteTowers))
     {
         for (int i = 0; i < listResearch.Count; i++)
         {
             ItemGameMainHintForResearchCpt itemCpt = listResearch[i];
             MenuOwnBean  menuOwn = itemCpt.GetMenuData();
             BuildBedBean bedData = itemCpt.GetBedData();
             if (menuOwn != null)
             {
                 if (menuOwn.GetMenuStatus() != ResearchStatusEnum.Researching)
                 {
                     listResearch.Remove(itemCpt);
                     Destroy(itemCpt.gameObject);
                     i--;
                     continue;
                 }
             }
             if (bedData != null)
             {
                 if (bedData.GetBedStatus() != ResearchStatusEnum.Researching)
                 {
                     listResearch.Remove(itemCpt);
                     Destroy(itemCpt.gameObject);
                     i--;
                     continue;
                 }
             }
         }
         for (int i = 0; i < listInfiniteTowers.Count; i++)
         {
             ItemGameMainHintForInfiniteTowersCpt itemCpt = listInfiniteTowers[i];
             if (itemCpt.infiniteTowersData.proForSend == -1)
             {
                 listInfiniteTowers.Remove(itemCpt);
                 Destroy(itemCpt.gameObject);
                 i--;
                 continue;
             }
         }
         CheckHasData();
     }
 }