示例#1
0
 private void UpdateStorageLogList()
 {
     this.storageLogListPool.Clear();
     if (GuildStorageManager.Instance.GuildStorageInfo != null && GuildStorageManager.Instance.GuildStorageInfo.logTraces != null && GuildStorageManager.Instance.GuildStorageInfo.logTraces.get_Count() > 0)
     {
         if (this.noGuildStorageTipObj != null && this.noGuildStorageTipObj.get_activeSelf())
         {
             this.noGuildStorageTipObj.SetActive(false);
         }
         List <GuildLogTrace> guildStorageList = GuildStorageManager.Instance.GetGuildStorageLogList(GuildStorageManager.Instance.GuildStorageInfo.logTraces);
         this.storageLogListPool.Create(guildStorageList.get_Count(), delegate(int index)
         {
             if (index < guildStorageList.get_Count() && index < this.storageLogListPool.Items.get_Count())
             {
                 GuildLogItem component = this.storageLogListPool.Items.get_Item(index).GetComponent <GuildLogItem>();
                 if (component != null)
                 {
                     component.RefreshUI(guildStorageList.get_Item(index));
                 }
             }
         });
     }
     else if (this.noGuildStorageTipObj != null && !this.noGuildStorageTipObj.get_activeSelf())
     {
         this.noGuildStorageTipObj.SetActive(true);
     }
 }
示例#2
0
    private void RefreshGuildLogPanel()
    {
        List <GuildLogTrace> guildLogList = GuildManager.Instance.GuildLogList;
        int i;

        for (i = 0; i < guildLogList.get_Count(); i++)
        {
            if (this.listViewGuildLogContair.get_childCount() > i)
            {
                GameObject gameObject = this.listViewGuildLogContair.GetChild(i).get_gameObject();
                if (gameObject != null && gameObject.GetComponent <GuildLogItem>() != null)
                {
                    gameObject.SetActive(true);
                    gameObject.GetComponent <GuildLogItem>().RefreshUI(guildLogList.get_Item(i));
                }
            }
            else
            {
                GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("GuildLogItem");
                instantiate2Prefab.set_name("guildLogItem_" + i);
                GuildLogItem component = instantiate2Prefab.GetComponent <GuildLogItem>();
                instantiate2Prefab.get_transform().SetParent(this.listViewGuildLogContair);
                instantiate2Prefab.GetComponent <RectTransform>().set_localScale(Vector3.get_one());
                component.RefreshUI(guildLogList.get_Item(i));
            }
        }
        for (int j = i; j < this.listViewGuildLogContair.get_childCount(); j++)
        {
            GameObject gameObject2 = this.listViewGuildLogContair.GetChild(j).get_gameObject();
            if (gameObject2 != null)
            {
                gameObject2.SetActive(false);
            }
        }
    }