Пример #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];
        }
Пример #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;
            }
        }
Пример #3
0
 public void UpdateTitleByItemIndex(ExampleItemModel model)
 {
     titleText.text = model.title + " #" + ItemIndex;
 }