提交 | 用户 | age
|
bbbc4c
|
1 |
using vnxbqy.UI; |
L |
2 |
using UnityEngine; |
|
3 |
using System.Collections.Generic; |
|
4 |
|
|
5 |
public class TreasureReverberationBehavior : MonoBehaviour |
|
6 |
{
|
|
7 |
[SerializeField] ScrollerController scroller;
|
|
8 |
public void Display()
|
|
9 |
{
|
|
10 |
scroller.Refresh();
|
|
11 |
List<int> reverberationList = TreasurePavilionModel.Instance.GetReverberationList();
|
|
12 |
reverberationList.Sort(TreasurePavilionModel.Instance.CmpResonance);
|
|
13 |
for (int i = 0; i < reverberationList.Count; i++)
|
|
14 |
{
|
|
15 |
int resonanceID = reverberationList[i];
|
|
16 |
scroller.AddCell(ScrollerDataType.Header, resonanceID);
|
|
17 |
}
|
|
18 |
scroller.Restart();
|
|
19 |
scroller.JumpIndex(TreasurePavilionModel.Instance.GetJumpIndex());
|
|
20 |
}
|
|
21 |
|
|
22 |
void OnEnable()
|
|
23 |
{
|
|
24 |
scroller.OnRefreshCell += OnRefreshCell1;
|
|
25 |
}
|
|
26 |
|
|
27 |
void OnDisable()
|
|
28 |
{
|
|
29 |
scroller.OnRefreshCell += OnRefreshCell1;
|
|
30 |
}
|
|
31 |
|
|
32 |
void OnRefreshCell1(ScrollerDataType type, CellView cell)
|
|
33 |
{
|
|
34 |
var _cell = cell as TreasurePavilionHeadCell;
|
|
35 |
_cell.Display(_cell.index);
|
|
36 |
}
|
|
37 |
|
|
38 |
public void Open()
|
|
39 |
{
|
|
40 |
gameObject.SetActive(true);
|
|
41 |
}
|
|
42 |
|
|
43 |
public void Close()
|
|
44 |
{
|
|
45 |
gameObject.SetActive(false);
|
|
46 |
}
|
|
47 |
}
|