예제 #1
0
        // Token: 0x0600475C RID: 18268 RVA: 0x00182604 File Offset: 0x00180A04
        private List <ListViewStringComponent> GetNewComponents()
        {
            this.componentsCache = (from x in this.componentsCache
                                    where x != null
                                    select x).ToList <ListViewStringComponent>();
            List <ListViewStringComponent> new_components = new List <ListViewStringComponent>();

            this.strings.ForEach(delegate(string x, int i)
            {
                if (i >= this.visibleItems)
                {
                    return;
                }
                if (this.components.Count > 0)
                {
                    new_components.Add(this.components[0]);
                    this.components.RemoveAt(0);
                }
                else if (this.componentsCache.Count > 0)
                {
                    this.componentsCache[0].gameObject.SetActive(true);
                    new_components.Add(this.componentsCache[0]);
                    this.componentsCache.RemoveAt(0);
                }
                else
                {
                    ImageAdvanced imageAdvanced = UnityEngine.Object.Instantiate <ImageAdvanced>(this.DefaultItem);
                    imageAdvanced.gameObject.SetActive(true);
                    ListViewStringComponent listViewStringComponent = imageAdvanced.GetComponent <ListViewStringComponent>();
                    if (listViewStringComponent == null)
                    {
                        listViewStringComponent            = imageAdvanced.gameObject.AddComponent <ListViewStringComponent>();
                        listViewStringComponent.Background = imageAdvanced;
                        listViewStringComponent.Text       = imageAdvanced.GetComponentInChildren <Text>();
                    }
                    Utilites.FixInstantiated(this.DefaultItem, imageAdvanced);
                    listViewStringComponent.gameObject.SetActive(true);
                    new_components.Add(listViewStringComponent);
                }
            });
            this.components.ForEach(delegate(ListViewStringComponent x)
            {
                x.gameObject.SetActive(false);
            });
            this.componentsCache.AddRange(this.components);
            this.components.Clear();
            return(new_components);
        }
예제 #2
0
 /// <summary>
 /// Sets the default item.
 /// </summary>
 /// <param name="newDefaultItem">New default item.</param>
 protected override void SetDefaultItem(ImageAdvanced newDefaultItem)
 {
     if (newDefaultItem != null)
     {
         if (defaultItemCopy != null)
         {
             Destroy(defaultItemCopy.gameObject);
             defaultItemCopy = null;
         }
         if (defaultItemCopyRect != null)
         {
             Destroy(defaultItemCopyRect.gameObject);
             defaultItemCopyRect = null;
         }
     }
     base.SetDefaultItem(newDefaultItem);
 }
예제 #3
0
 /// <summary>
 /// Awake this instance.
 /// </summary>
 protected override void Awake()
 {
     Background = GetComponent <ImageAdvanced>();
 }