Ejemplo n.º 1
0
        /// <inheritdoc/>
        protected override void UpdateViewsHolder(MyItemViewsHolder newOrRecycled)
        {
            // Initialize the views from the associated model
            ExampleItemModel model = Data[newOrRecycled.ItemIndex];

            newOrRecycled.backgroundImage.color = model.color;
            newOrRecycled.UpdateTitleByItemIndex(model);
            newOrRecycled.icon1Image.texture = _Params.availableIcons[model.icon1Index];
            newOrRecycled.icon2Image.texture = _Params.availableIcons[model.icon2Index];
        }
Ejemplo n.º 2
0
        /// <inheritdoc/>
        protected override void UpdateViewsHolder(MyItemViewsHolder newOrRecycled)
        {
            // Initialize the views from the associated model
            ExampleItemModel model = LazyData.GetOrCreate(newOrRecycled.ItemIndex);

            newOrRecycled.backgroundImage.color = model.color;
            newOrRecycled.UpdateTitleByItemIndex(model);
            newOrRecycled.icon1Image.texture = _Params.availableIcons[model.icon1Index];
            newOrRecycled.icon2Image.texture = _Params.availableIcons[model.icon2Index];

            if (newOrRecycled.expandOnCollapseComponent)
            {
                newOrRecycled.expandOnCollapseComponent.expanded        = model.expanded;
                newOrRecycled.expandOnCollapseComponent.nonExpandedSize = model.nonExpandedSize;
            }
        }
Ejemplo n.º 3
0
 public void UpdateTitleByItemIndex(ExampleItemModel model)
 {
     titleText.text = model.title + " #" + ItemIndex;
 }