|
@@ -13,10 +13,19 @@ namespace GFGGame
|
|
{
|
|
{
|
|
private UI_LeagueSkillUpUI _ui;
|
|
private UI_LeagueSkillUpUI _ui;
|
|
private ValueBarController _valueBarController;
|
|
private ValueBarController _valueBarController;
|
|
|
|
+ private GameObject _gameObject0;
|
|
|
|
+ private GameObject _gameObject1;
|
|
|
|
+ private GameObject _gameObject2;
|
|
|
|
+ private GoWrapper _wrapper0;
|
|
|
|
+ private GoWrapper _wrapper1;
|
|
|
|
+ private GoWrapper _wrapper2;
|
|
private int _pageCount;
|
|
private int _pageCount;
|
|
private int _type;
|
|
private int _type;
|
|
public override void Dispose()
|
|
public override void Dispose()
|
|
{
|
|
{
|
|
|
|
+ SceneController.DestroyObjectFromView(_gameObject0, _wrapper0);
|
|
|
|
+ SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
|
|
|
|
+ SceneController.DestroyObjectFromView(_gameObject2, _wrapper2);
|
|
if (_valueBarController != null)
|
|
if (_valueBarController != null)
|
|
{
|
|
{
|
|
_valueBarController.Dispose();
|
|
_valueBarController.Dispose();
|
|
@@ -39,16 +48,23 @@ namespace GFGGame
|
|
isfullScreen = true;
|
|
isfullScreen = true;
|
|
|
|
|
|
_ui.m_btnBack.onClick.Add(OnBtnBackClick);
|
|
_ui.m_btnBack.onClick.Add(OnBtnBackClick);
|
|
- _ui.m_listScore.itemRenderer = RenderListScoreItem;
|
|
|
|
- _ui.m_list.itemRenderer = RenderListItem;
|
|
|
|
- _ui.m_list.SetVirtual();
|
|
|
|
- _ui.m_list.scrollPane.decelerationRate = 0.8f;
|
|
|
|
- _ui.m_btnLeft.onClick.Add(OnBtnLeftClick);
|
|
|
|
- _ui.m_btnRight.onClick.Add(OnBtnRightClick);
|
|
|
|
|
|
+ _ui.m_comSkill.m_listScore.itemRenderer = RenderListScoreItem;
|
|
|
|
+ _ui.m_comSkill.m_list.itemRenderer = RenderListItem;
|
|
|
|
+ _ui.m_comSkill.m_list.SetVirtual();
|
|
|
|
+ _ui.m_comSkill.m_list.scrollPane.decelerationRate = 0.8f;
|
|
|
|
+ _ui.m_comSkill.m_btnLeft.onClick.Add(OnBtnLeftClick);
|
|
|
|
+ _ui.m_comSkill.m_btnRight.onClick.Add(OnBtnRightClick);
|
|
|
|
|
|
_valueBarController = new ValueBarController(_ui.m_comValue);
|
|
_valueBarController = new ValueBarController(_ui.m_comValue);
|
|
|
|
|
|
_ui.m_loaBg.url = ResPathUtil.GetBgImgPath("lm_ch_jnbg");
|
|
_ui.m_loaBg.url = ResPathUtil.GetBgImgPath("lm_ch_jnbg");
|
|
|
|
+
|
|
|
|
+ string resPath = ResPathUtil.GetViewEffectPath("ui_league", "TEA");
|
|
|
|
+ SceneController.AddObjectToView(null, null, _ui.m_holder, resPath, out _gameObject0, out _wrapper0);
|
|
|
|
+ string resPath1 = ResPathUtil.GetViewEffectPath("ui_league", "tea_unlock");
|
|
|
|
+ SceneController.AddObjectToView(null, null, _ui.m_holderSkill, resPath1, out _gameObject1, out _wrapper1);
|
|
|
|
+ string resPath2 = ResPathUtil.GetViewEffectPath("ui_league", "tea_unlock");
|
|
|
|
+ SceneController.AddObjectToView(null, null, _ui.m_holderScore, resPath2, out _gameObject2, out _wrapper2, 90);
|
|
}
|
|
}
|
|
protected override void AddEventListener()
|
|
protected override void AddEventListener()
|
|
{
|
|
{
|
|
@@ -61,8 +77,8 @@ namespace GFGGame
|
|
_type = (int)this.viewData;
|
|
_type = (int)this.viewData;
|
|
_valueBarController.OnShown();
|
|
_valueBarController.OnShown();
|
|
_valueBarController.Controller(11);
|
|
_valueBarController.Controller(11);
|
|
- _ui.m_list.numItems = LeagueSkillCountCfgArray.Instance.GetCfg(_type).layerCount;
|
|
|
|
-
|
|
|
|
|
|
+ _ui.m_comSkill.m_list.numItems = LeagueSkillCountCfgArray.Instance.GetCfg(_type).layerCount;
|
|
|
|
+ _ui.m_t0.Play();
|
|
UpdateView();
|
|
UpdateView();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -70,7 +86,9 @@ namespace GFGGame
|
|
{
|
|
{
|
|
base.OnHide();
|
|
base.OnHide();
|
|
_valueBarController.OnHide();
|
|
_valueBarController.OnHide();
|
|
- if (_ui.m_list.numItems > 0) _ui.m_list.ScrollToView(0);
|
|
|
|
|
|
+ if (_ui.m_comSkill.m_list.numItems > 0) _ui.m_comSkill.m_list.ScrollToView(0);
|
|
|
|
+ _ui.m_t0.Stop();
|
|
|
|
+ _ui.m_t1.Stop();
|
|
}
|
|
}
|
|
|
|
|
|
protected override void RemoveEventListener()
|
|
protected override void RemoveEventListener()
|
|
@@ -85,21 +103,21 @@ namespace GFGGame
|
|
}
|
|
}
|
|
private void OnBtnRightClick()
|
|
private void OnBtnRightClick()
|
|
{
|
|
{
|
|
- int index = _ui.m_list.GetFirstChildInView();
|
|
|
|
- int curPage = index / _ui.m_list.lineCount;
|
|
|
|
|
|
+ int index = _ui.m_comSkill.m_list.GetFirstChildInView();
|
|
|
|
+ int curPage = index / _ui.m_comSkill.m_list.lineCount;
|
|
int nextPage = curPage + 1;
|
|
int nextPage = curPage + 1;
|
|
- if (nextPage * _ui.m_list.lineCount > _ui.m_list.numItems - 1) return;
|
|
|
|
- _ui.m_list.ScrollToView(nextPage * _ui.m_list.lineCount, true);
|
|
|
|
|
|
+ if (nextPage * _ui.m_comSkill.m_list.lineCount > _ui.m_comSkill.m_list.numItems - 1) return;
|
|
|
|
+ _ui.m_comSkill.m_list.ScrollToView(nextPage * _ui.m_comSkill.m_list.lineCount, true);
|
|
Debug.Log("curPage:" + nextPage);
|
|
Debug.Log("curPage:" + nextPage);
|
|
|
|
|
|
}
|
|
}
|
|
private void OnBtnLeftClick()
|
|
private void OnBtnLeftClick()
|
|
{
|
|
{
|
|
- int index = _ui.m_list.GetFirstChildInView();
|
|
|
|
- int curPage = index / _ui.m_list.lineCount;
|
|
|
|
|
|
+ int index = _ui.m_comSkill.m_list.GetFirstChildInView();
|
|
|
|
+ int curPage = index / _ui.m_comSkill.m_list.lineCount;
|
|
int lastPage = curPage - 1;
|
|
int lastPage = curPage - 1;
|
|
- if (lastPage * _ui.m_list.lineCount < 0) return;
|
|
|
|
- _ui.m_list.ScrollToView(lastPage * _ui.m_list.lineCount, true);
|
|
|
|
|
|
+ if (lastPage * _ui.m_comSkill.m_list.lineCount < 0) return;
|
|
|
|
+ _ui.m_comSkill.m_list.ScrollToView(lastPage * _ui.m_comSkill.m_list.lineCount, true);
|
|
Debug.Log("curPage:" + lastPage);
|
|
Debug.Log("curPage:" + lastPage);
|
|
|
|
|
|
}
|
|
}
|
|
@@ -107,9 +125,9 @@ namespace GFGGame
|
|
{
|
|
{
|
|
if (LeagueDataManager.Instance.GetSkillProgressByType(_type) < 100 && LeagueDataManager.Instance.GetSkillProgressByType(_type) > 0)
|
|
if (LeagueDataManager.Instance.GetSkillProgressByType(_type) < 100 && LeagueDataManager.Instance.GetSkillProgressByType(_type) > 0)
|
|
{
|
|
{
|
|
- if (LeagueDataManager.Instance.CurLayer == _ui.m_list.numItems)
|
|
|
|
|
|
+ if (LeagueDataManager.Instance.CurLayer == _ui.m_comSkill.m_list.numItems)
|
|
{
|
|
{
|
|
- _ui.m_list.ScrollToView(LeagueDataManager.Instance.CurLayer - 1);
|
|
|
|
|
|
+ _ui.m_comSkill.m_list.ScrollToView(LeagueDataManager.Instance.CurLayer - 1);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -125,17 +143,17 @@ namespace GFGGame
|
|
}
|
|
}
|
|
if (isActive)
|
|
if (isActive)
|
|
{
|
|
{
|
|
- _ui.m_list.ScrollToView(LeagueDataManager.Instance.CurLayer);
|
|
|
|
|
|
+ _ui.m_comSkill.m_list.ScrollToView(LeagueDataManager.Instance.CurLayer);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- _ui.m_list.ScrollToView(LeagueDataManager.Instance.CurLayer - 1);
|
|
|
|
|
|
+ _ui.m_comSkill.m_list.ScrollToView(LeagueDataManager.Instance.CurLayer - 1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// _ui.m_list.ScrollToView(LeagueDataManager.Instance.CurLayer - 1);
|
|
// _ui.m_list.ScrollToView(LeagueDataManager.Instance.CurLayer - 1);
|
|
}
|
|
}
|
|
- _ui.m_listScore.numItems = 4;
|
|
|
|
- _ui.m_list.RefreshVirtualList();
|
|
|
|
|
|
+ _ui.m_comSkill.m_listScore.numItems = 4;
|
|
|
|
+ _ui.m_comSkill.m_list.RefreshVirtualList();
|
|
_ui.m_txtTitle.text = "茶艺-" + LeagueSkillCountCfgArray.Instance.GetCfg(_type).name;
|
|
_ui.m_txtTitle.text = "茶艺-" + LeagueSkillCountCfgArray.Instance.GetCfg(_type).name;
|
|
double progress = LeagueDataManager.Instance.GetSkillProgressByType(_type);
|
|
double progress = LeagueDataManager.Instance.GetSkillProgressByType(_type);
|
|
_ui.m_txtProgress.SetVar("value", progress.ToString()).FlushVars();
|
|
_ui.m_txtProgress.SetVar("value", progress.ToString()).FlushVars();
|
|
@@ -215,6 +233,14 @@ namespace GFGGame
|
|
bool result = await SkillSProxy.ReqActiveSkill(SkillType.LeagueSkill, skillId);
|
|
bool result = await SkillSProxy.ReqActiveSkill(SkillType.LeagueSkill, skillId);
|
|
if (result)
|
|
if (result)
|
|
{
|
|
{
|
|
|
|
+ Vector2 posInSkill = obj.TransformPoint(new Vector2(obj.width / 2, obj.height / 2), _ui.target);
|
|
|
|
+ _ui.m_holderSkill.position = posInSkill;
|
|
|
|
+
|
|
|
|
+ GObject scoreObj = _ui.m_comSkill.m_listScore.GetChildAt(skillCfg.score - 1);
|
|
|
|
+ Vector2 posInScore = scoreObj.TransformPoint(new Vector2(scoreObj.width / 2, scoreObj.height / 2), _ui.target);
|
|
|
|
+ _ui.m_holderScore.position = posInScore;
|
|
|
|
+
|
|
|
|
+ _ui.m_t1.Play();
|
|
UpdateView();
|
|
UpdateView();
|
|
}
|
|
}
|
|
}
|
|
}
|