|
@@ -14,7 +14,6 @@ namespace GFGGame
|
|
|
{
|
|
|
private UI_CardGuideUI _ui;
|
|
|
private List<int> _cardList;
|
|
|
- private bool _startInAnim;
|
|
|
private int _lastClickIndex;
|
|
|
|
|
|
public override void Dispose()
|
|
@@ -44,7 +43,6 @@ namespace GFGGame
|
|
|
_ui.m_listRole.onClickItem.Add(OnClickRoleListItem);
|
|
|
_ui.m_btnBack.onClick.Add(OnClickBtnBack);
|
|
|
_ui.m_listRole.selectedIndex = 0;
|
|
|
- _startInAnim = true;
|
|
|
}
|
|
|
|
|
|
protected override void AddEventListener()
|
|
@@ -67,19 +65,16 @@ namespace GFGGame
|
|
|
{
|
|
|
base.OnShown();
|
|
|
UpdateCardList();
|
|
|
- if (_startInAnim)
|
|
|
- {
|
|
|
- _startInAnim = false;
|
|
|
- _ui.m_listRole.scrollPane.ScrollTop();
|
|
|
- _ui.m_In.Play();
|
|
|
- }
|
|
|
+
|
|
|
+ // 以下代码只在从图鉴进入时才执行
|
|
|
+ ResetSelectedItem();
|
|
|
+ _ui.m_listCard.scrollPane.ScrollTop();
|
|
|
+ _ui.m_In.Play();
|
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
|
{
|
|
|
base.OnHide();
|
|
|
- _ui.m_listRole.selectedIndex = 0;
|
|
|
- _lastClickIndex = 0;
|
|
|
}
|
|
|
|
|
|
private void RenderCardListItem(int index, GObject obj)
|
|
@@ -179,8 +174,13 @@ namespace GFGGame
|
|
|
|
|
|
private void OnClickBtnBack()
|
|
|
{
|
|
|
- _startInAnim = true;
|
|
|
Hide();
|
|
|
}
|
|
|
+
|
|
|
+ private void ResetSelectedItem()
|
|
|
+ {
|
|
|
+ _ui.m_listRole.selectedIndex = 0;
|
|
|
+ _lastClickIndex = 0;
|
|
|
+ }
|
|
|
}
|
|
|
}
|