|
@@ -54,6 +54,9 @@ namespace GFGGame
|
|
|
GLoader icon = btnSkill.GetChild("icon").asLoader;
|
|
|
icon.onClick.Add(() => { OnBtnSkillClick(btnSkill); });
|
|
|
}
|
|
|
+ _ui.m_btnBack.onClick.Add(OnBtnBackClick);
|
|
|
+ EventAgent.AddEventListener(ConstMessage.CARD_SKILL, UpdateCircleResult);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
protected override void OnInit()
|
|
@@ -89,23 +92,17 @@ namespace GFGGame
|
|
|
_mainScore = ScoreSystemData.Instance.GetMainScore();
|
|
|
_targetMainScore = fightCfg.targetMainScore;
|
|
|
|
|
|
- Timers.inst.Add(0.5f, 1, (param) =>
|
|
|
- {
|
|
|
- CircleScoreStart(null);
|
|
|
- });//评分结束
|
|
|
+ Timers.inst.Add(0.5f, 1, CircleScoreStart);//评分结束
|
|
|
}
|
|
|
private void UpdateNormal()
|
|
|
{
|
|
|
- _ui.m_btnSkill0.m_proCD.visible = false;
|
|
|
- _ui.m_btnSkill1.m_proCD.visible = false;
|
|
|
- _ui.m_btnSkill2.m_proCD.visible = false;
|
|
|
- _ui.m_btnSkill3.m_proCD.visible = false;
|
|
|
- _ui.m_ComMinusNpc.target.visible = false;
|
|
|
- _ui.m_ComMinusMine.target.visible = false;
|
|
|
- _ui.m_ComShieldNpc.target.visible = false;
|
|
|
- _ui.m_ComShieldMine.target.visible = false;
|
|
|
- _ui.m_proScore.target.max = 100;
|
|
|
- _ui.m_proScore.target.value = 50;
|
|
|
+ Reset();
|
|
|
+ RoleSkillCfg[] roleSkillCfgs = RoleSkillCfgArray.Instance.dataArray;
|
|
|
+ for (int i = 0; i < roleSkillCfgs.Length; i++)
|
|
|
+ {
|
|
|
+ GComponent btnSkill = _ui.target.GetChild("btnSkill" + i).asCom;
|
|
|
+ // btnSkill.GetTransition("t0").Play(1, 0, null);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void CircleScoreStart(object param)
|
|
@@ -131,7 +128,7 @@ namespace GFGGame
|
|
|
{
|
|
|
int partId = FightScoreCfgArray.Instance.dataArray[_index].id;
|
|
|
double partScore = ScoreSystemData.Instance.GetPartItemScore(partId);
|
|
|
- _ui.m_comMineCircle.m_txtCount0.text = ((int)partScore).ToString();
|
|
|
+ _ui.m_comMineCircle.m_txtCount.text = ((int)partScore).ToString();
|
|
|
_score += (partScore + _skillScore);
|
|
|
EquipDataCache.cacher.totalScore = (int)Math.Round(_score);
|
|
|
|
|
@@ -139,12 +136,12 @@ namespace GFGGame
|
|
|
StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(StoryDataManager.currentLevelID);
|
|
|
StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
|
|
|
double targetScore = fightCfg.targetPartsScoreArr[_index] * ConstScoreSystem.PART_SCORE;
|
|
|
- _ui.m_comTargetCircle.m_txtCount0.text = targetScore.ToString();
|
|
|
+ _ui.m_comTargetCircle.m_txtCount.text = targetScore.ToString();
|
|
|
_targetScore += targetScore;
|
|
|
EquipDataCache.cacher.npcTotalScore = (int)Math.Round(_targetScore);
|
|
|
|
|
|
UpdateProgressBar();
|
|
|
- SetCirclePos();
|
|
|
+ PlayScoreAni();
|
|
|
ReleaseNpcSkill();
|
|
|
}
|
|
|
private void UpdateProgressBar()
|
|
@@ -154,18 +151,14 @@ namespace GFGGame
|
|
|
double value = _score / (_score + _targetScore) * _ui.m_proScore.target.max;
|
|
|
_ui.m_proScore.target.TweenValue(value, 0.5f);
|
|
|
}
|
|
|
- private void SetCirclePos()
|
|
|
+ private void PlayScoreAni()
|
|
|
{
|
|
|
- Vector2 pos = (_ui.target.GetChild("grh_" + _index).asGraph).xy;
|
|
|
- float x = 0f;
|
|
|
- float y = 0f;
|
|
|
- EquipDataCache.cacher.GetCirclePos(pos, _range, out x, out y);
|
|
|
- _ui.m_comMineCircle.target.SetXY(x, y);
|
|
|
_ui.m_comMineCircle.target.visible = true;
|
|
|
+ _ui.m_comMineCircle.m_txtPart.text = FightScoreCfgArray.Instance.GetCfg(_index + 1).name;
|
|
|
_ui.m_comMineCircle.m_t0.Play(CircleScoreEnd);
|
|
|
|
|
|
- _ui.m_comTargetCircle.target.SetXY(_ui.target.width - x, y);
|
|
|
_ui.m_comTargetCircle.target.visible = true;
|
|
|
+ _ui.m_comTargetCircle.m_txtPart.text = FightScoreCfgArray.Instance.GetCfg(_index + 1).name;
|
|
|
_ui.m_comTargetCircle.m_t0.Play();
|
|
|
}
|
|
|
private void CircleScoreEnd()
|
|
@@ -177,10 +170,9 @@ namespace GFGGame
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- Timers.inst.Add(0.5f, 1, (param) =>
|
|
|
- {
|
|
|
- CircleScoreStart(null);
|
|
|
- });//评分结束
|
|
|
+ _ui.m_comTargetCircle.target.visible = false;
|
|
|
+ _ui.m_comMineCircle.target.visible = false;
|
|
|
+ Timers.inst.Add(0.5f, 1, CircleScoreStart);//评分结束
|
|
|
}
|
|
|
}
|
|
|
private void ReleaseNpcSkill()
|
|
@@ -197,15 +189,29 @@ namespace GFGGame
|
|
|
{
|
|
|
UI_ComBtnSkill item = UI_ComBtnSkill.Proxy(obj);
|
|
|
RoleSkillCfg cfg = item.target.data as RoleSkillCfg;
|
|
|
-
|
|
|
- SetCdState(item.m_proCD, cfg.cd);
|
|
|
+ int count = (int)item.m_icon.data;
|
|
|
+ if (count >= cfg.limiteCount) return;//超过最大限制次数
|
|
|
+ item.m_c1.selectedIndex = 1;
|
|
|
+ item.m_icon.data = count + 1;
|
|
|
+ SetCdState(obj, cfg.cd);
|
|
|
SetSkillValue(cfg, SkillDataManager.MINE);
|
|
|
}
|
|
|
- private void SetCdState(GProgressBar bar, float time)
|
|
|
+ private void SetCdState(GComponent obj, float time)
|
|
|
{
|
|
|
+ UI_ComBtnSkill item = UI_ComBtnSkill.Proxy(obj);
|
|
|
+ GProgressBar bar = item.m_proCD;
|
|
|
bar.visible = true;
|
|
|
bar.value = 100;
|
|
|
- bar.TweenValue(0, time).OnComplete(() => { bar.visible = false; });
|
|
|
+ bar.TweenValue(0, time).OnComplete((GTweener tweener) =>
|
|
|
+ {
|
|
|
+ GProgressBar bar = (GProgressBar)tweener.target;
|
|
|
+ UI_ComBtnSkill item = UI_ComBtnSkill.Proxy(bar.parent);
|
|
|
+ int count = (int)item.m_icon.data;
|
|
|
+ RoleSkillCfg cfg = item.target.data as RoleSkillCfg;
|
|
|
+ item.m_c1.selectedIndex = count >= cfg.limiteCount ? 2 : 0;
|
|
|
+
|
|
|
+ item.m_proCD.visible = false;
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
private void SetSkillValue(RoleSkillCfg cfg, int role)
|
|
@@ -231,7 +237,6 @@ namespace GFGGame
|
|
|
private void UpdateAddUI(RoleSkillCfg cfg, int role)
|
|
|
{
|
|
|
UI_ComRoleSkillScore comRoleSkillScore = role == SkillDataManager.MINE ? _ui.m_ComRoleSkillMineAdd : _ui.m_ComRoleSkillNpcAdd;
|
|
|
- comRoleSkillScore.m_c1.selectedIndex = 0;
|
|
|
int score = 0;
|
|
|
if (role == SkillDataManager.MINE)
|
|
|
{
|
|
@@ -243,7 +248,8 @@ namespace GFGGame
|
|
|
score = (int)_targetMainScore * cfg.value / 100;
|
|
|
_targetScore += score;
|
|
|
}
|
|
|
- comRoleSkillScore.m_txtScore.SetVar("count", score.ToString()).FlushVars();
|
|
|
+ comRoleSkillScore.m_comRoleSkill.m_c1.selectedIndex = 0;
|
|
|
+ comRoleSkillScore.m_comRoleSkill.m_txtScore.SetVar("count", score.ToString()).FlushVars();
|
|
|
comRoleSkillScore.m_t0.Play();
|
|
|
|
|
|
UpdateProgressBar();
|
|
@@ -253,14 +259,14 @@ namespace GFGGame
|
|
|
//荆钗效果
|
|
|
private void UpdateMinusUI(RoleSkillCfg cfg, int role)
|
|
|
{
|
|
|
- UI_ComSkillMinus comSkillMinus = role == SkillDataManager.MINE ? _ui.m_ComMinusMine : _ui.m_ComMinusNpc;
|
|
|
+ GProgressBar comSkillMinus = role == SkillDataManager.MINE ? _ui.m_proMinusMine : _ui.m_proMinusNpc;
|
|
|
UI_ComSkillShield targetComSkillShield = role == SkillDataManager.MINE ? _ui.m_ComShieldNpc : _ui.m_ComShieldMine;
|
|
|
|
|
|
- comSkillMinus.target.visible = true;
|
|
|
- comSkillMinus.m_proMinus.target.value = 0;
|
|
|
- comSkillMinus.m_proMinus.target.TweenValue(100, 2f).OnComplete(() =>
|
|
|
+ comSkillMinus.visible = true;
|
|
|
+ comSkillMinus.value = 0;
|
|
|
+ comSkillMinus.TweenValue(100, 2f).OnComplete(() =>
|
|
|
{
|
|
|
- comSkillMinus.target.visible = false;
|
|
|
+ comSkillMinus.visible = false;
|
|
|
if (targetComSkillShield.target.visible)
|
|
|
{
|
|
|
targetComSkillShield.target.visible = false;
|
|
@@ -282,10 +288,9 @@ namespace GFGGame
|
|
|
_score -= score;
|
|
|
}
|
|
|
|
|
|
- comRoleSkillScore.m_c1.selectedIndex = 1;
|
|
|
- comRoleSkillScore.m_txtScore.SetVar("count", score.ToString()).FlushVars();
|
|
|
- comRoleSkillScore.m_t0.Play();
|
|
|
-
|
|
|
+ comRoleSkillScore.m_comRoleSkill.m_c1.selectedIndex = 1;
|
|
|
+ comRoleSkillScore.m_comRoleSkill.m_txtScore.SetVar("count", score.ToString()).FlushVars();
|
|
|
+ comRoleSkillScore.m_t1.Play();
|
|
|
UpdateProgressBar();
|
|
|
|
|
|
});
|
|
@@ -293,13 +298,13 @@ namespace GFGGame
|
|
|
private void UpdateBreakUI(RoleSkillCfg cfg, int role)
|
|
|
{
|
|
|
|
|
|
- UI_ComSkillMinus targetSkillMinus = role == SkillDataManager.MINE ? _ui.m_ComMinusNpc : _ui.m_ComMinusMine;
|
|
|
- targetSkillMinus.target.visible = false;
|
|
|
+ GProgressBar targetSkillMinus = role == SkillDataManager.MINE ? _ui.m_proMinusNpc : _ui.m_proMinusMine;
|
|
|
+ targetSkillMinus.visible = false;
|
|
|
|
|
|
- GTweener twener = GTween.GetTween(targetSkillMinus.m_proMinus, TweenPropType.Progress);
|
|
|
+ GTweener twener = GTween.GetTween(targetSkillMinus, TweenPropType.Progress);
|
|
|
if (twener != null)
|
|
|
{
|
|
|
- twener.Kill(true);
|
|
|
+ twener.Kill();
|
|
|
}
|
|
|
}
|
|
|
//锦衣效果
|
|
@@ -310,7 +315,13 @@ namespace GFGGame
|
|
|
|
|
|
Timers.inst.Add(cfg.duration, 1, (param) => { comSkillShield.target.visible = false; });
|
|
|
}
|
|
|
+ private void OnBtnBackClick()
|
|
|
+ {
|
|
|
+ Reset();
|
|
|
+ this.Hide();
|
|
|
+ ViewManager.Show(ViewName.STORY_CHAPTER_VIEW, StoryDataManager.currentChapter, ViewManager.GetGoBackDatas(ViewName.STORY_CHAPTER_VIEW));
|
|
|
|
|
|
+ }
|
|
|
protected override void OnHide()
|
|
|
{
|
|
|
base.OnHide();
|
|
@@ -324,14 +335,46 @@ namespace GFGGame
|
|
|
|
|
|
private void Skip(object param = null)
|
|
|
{
|
|
|
- Timers.inst.Remove((param) =>
|
|
|
- {
|
|
|
- CircleScoreStart(null);
|
|
|
- });
|
|
|
|
|
|
- Timers.inst.Remove(Skip);
|
|
|
+ Reset();
|
|
|
this.Hide();
|
|
|
ViewManager.Show(ViewName.STORY_FIGHT_RESULT_VIEW);
|
|
|
}
|
|
|
+ private void Reset()
|
|
|
+ {
|
|
|
+ _ui.m_proScore.target.max = 100;
|
|
|
+ _ui.m_proScore.target.value = 0;
|
|
|
+
|
|
|
+ _ui.m_comMineCircle.target.visible = false;
|
|
|
+ _ui.m_comTargetCircle.target.visible = false;
|
|
|
+
|
|
|
+ _ui.m_proMinusMine.visible = false;
|
|
|
+ _ui.m_proMinusNpc.visible = false;
|
|
|
+ GTweener twenerMine = GTween.GetTween(_ui.m_proMinusMine, TweenPropType.Progress);
|
|
|
+ if (twenerMine != null) twenerMine.Kill(true);
|
|
|
+ GTweener twenerNpc = GTween.GetTween(_ui.m_proMinusNpc, TweenPropType.Progress);
|
|
|
+ if (twenerNpc != null) twenerNpc.Kill(true);
|
|
|
+
|
|
|
+ _ui.m_ComShieldNpc.target.visible = false;
|
|
|
+ _ui.m_ComShieldMine.target.visible = false;
|
|
|
+
|
|
|
+ _ui.m_ComRoleSkillMineAdd.m_comRoleSkill.target.visible = false;
|
|
|
+ _ui.m_ComRoleSkillMineMinus.m_comRoleSkill.target.visible = false;
|
|
|
+ _ui.m_ComRoleSkillNpcAdd.m_comRoleSkill.target.visible = false;
|
|
|
+ _ui.m_ComRoleSkillNpcMinus.m_comRoleSkill.target.visible = false;
|
|
|
+
|
|
|
+ RoleSkillCfg[] roleSkillCfgs = RoleSkillCfgArray.Instance.dataArray;
|
|
|
+ for (int i = 0; i < roleSkillCfgs.Length; i++)
|
|
|
+ {
|
|
|
+ GComponent btnSkill = _ui.target.GetChild("btnSkill" + i).asCom;
|
|
|
+
|
|
|
+ btnSkill.GetChild("icon").asLoader.data = 0;
|
|
|
+ btnSkill.GetController("c1").selectedIndex = 0;
|
|
|
+ // btnSkill.GetTransition("t0").Stop();
|
|
|
+ }
|
|
|
+
|
|
|
+ Timers.inst.Remove(CircleScoreStart);
|
|
|
+ Timers.inst.Remove(Skip);
|
|
|
+ }
|
|
|
}
|
|
|
}
|