提交 | 用户 | age
|
a27c7f
|
1 |
using vnxbqy.UI; |
H |
2 |
using System.Collections.Generic; |
|
3 |
using UnityEngine; |
|
4 |
using UnityEngine.UI; |
|
5 |
|
|
6 |
class EquipDecomSuccessWin : ILWindow |
|
7 |
{ |
|
8 |
|
|
9 |
ScrollerController scroller; |
|
10 |
Button closeBtn; |
|
11 |
|
|
12 |
#region Built-in |
|
13 |
protected override void BindController() |
|
14 |
{ |
|
15 |
scroller = proxy.GetWidgtEx<ScrollerController>("ScrollerController"); |
|
16 |
closeBtn = proxy.GetWidgtEx<Button>("Btn_Close"); |
|
17 |
} |
|
18 |
|
|
19 |
protected override void AddListeners() |
|
20 |
{ |
|
21 |
closeBtn.SetListener(() => { |
|
22 |
WindowCenter.Instance.CloseIL<EquipDecomSuccessWin>(); |
|
23 |
}); |
|
24 |
} |
|
25 |
|
|
26 |
protected override void OnAfterOpen() |
|
27 |
{ |
|
28 |
scroller.OnRefreshCell += OnRefreshCell; |
|
29 |
scroller.Refresh(); |
|
30 |
|
|
31 |
for (int i = 0; i < EquipEvolveModel.Instance.decomposeItem.Length; i++) |
|
32 |
{ |
|
33 |
scroller.AddCell(ScrollerDataType.Header, i); |
|
34 |
} |
|
35 |
|
|
36 |
scroller.Restart(); |
|
37 |
|
|
38 |
} |
|
39 |
|
|
40 |
protected override void OnPreClose() |
|
41 |
{ |
|
42 |
scroller.OnRefreshCell -= OnRefreshCell; |
|
43 |
} |
|
44 |
|
|
45 |
#endregion |
|
46 |
|
|
47 |
|
|
48 |
void OnRefreshCell(ScrollerDataType type, CellView cell) |
|
49 |
{ |
|
50 |
var _cell = cell.GetComponent<ItemCell>(); |
|
51 |
|
|
52 |
var model = new ItemCellModel(EquipEvolveModel.Instance.decomposeItem[cell.index][0], false, |
|
53 |
(ulong)EquipEvolveModel.Instance.decomposeItem[cell.index][1]); |
|
54 |
_cell.Init(model); |
|
55 |
} |
|
56 |
} |