/* * FancyScrollView (https://github.com/setchi/FancyScrollView) * Copyright (c) 2020 setchi * Licensed under MIT (https://github.com/setchi/FancyScrollView/blob/master/LICENSE) */ using System.Collections.Generic; namespace UnityEngine.UI.Extensions.Examples.FancyScrollViewExample09 { class ScrollView : FancyScrollView { [SerializeField] Scroller scroller = default; [SerializeField] GameObject cellPrefab = default; protected override GameObject CellPrefab => cellPrefab; protected override void Initialize() { base.Initialize(); scroller.OnValueChanged(UpdatePosition); } public void UpdateData(IList items) { UpdateContents(items); scroller.SetTotalCount(items.Count); } } }