2018-12-31 23:16:28 +08:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
using System.Collections.Generic;
|
2017-08-02 17:21:45 +08:00
|
|
|
|
|
|
|
|
|
namespace UnityEngine.UI.Extensions.Examples
|
|
|
|
|
{
|
|
|
|
|
public class Example01ScrollView : FancyScrollView<Example01CellDto>
|
|
|
|
|
{
|
|
|
|
|
[SerializeField]
|
2018-12-31 23:16:28 +08:00
|
|
|
|
ScrollPositionController scrollPositionController;
|
2017-08-02 17:21:45 +08:00
|
|
|
|
|
2018-12-31 23:16:28 +08:00
|
|
|
|
void Awake()
|
2017-08-02 17:21:45 +08:00
|
|
|
|
{
|
2018-12-31 23:16:28 +08:00
|
|
|
|
scrollPositionController.OnUpdatePosition(p => UpdatePosition(p));
|
2017-08-02 17:21:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateData(List<Example01CellDto> data)
|
|
|
|
|
{
|
|
|
|
|
cellData = data;
|
|
|
|
|
scrollPositionController.SetDataCount(cellData.Count);
|
|
|
|
|
UpdateContents();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|