|
@@ -23,6 +23,9 @@ namespace GFGGame
|
|
|
private double _targetMainScore;//战斗目标总主属性分
|
|
|
private const int _range = 30;//圆圈随机范围
|
|
|
|
|
|
+ private float _speed = 1;
|
|
|
+ private bool isAutoPlay = false;
|
|
|
+
|
|
|
private GameObject _gameObject0;
|
|
|
private GoWrapper _wrapper0;
|
|
|
private GameObject _gameObject1;
|
|
@@ -85,15 +88,15 @@ namespace GFGGame
|
|
|
playStop = false;
|
|
|
_ui.m_comTargetCircle.target.visible = false;
|
|
|
_ui.m_comMineCircle.target.visible = false;
|
|
|
- // _ui.m_comMineCircle.m_t0.Stop(true, false);
|
|
|
- // _ui.m_comTargetCircle.m_t0.Stop(true, false);
|
|
|
+
|
|
|
_ui.m_comMineCircle.m_t0.Play(CircleScoreEnd);
|
|
|
_ui.m_comTargetCircle.m_t0.Play();
|
|
|
_ui.m_btnSkill0.target.touchable = true;
|
|
|
- // CircleScoreEnd();
|
|
|
|
|
|
}
|
|
|
});
|
|
|
+ _ui.m_btnSpeedUp.onClick.Add(OnBtnSpeedUp);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
protected override void OnShown()
|
|
@@ -111,7 +114,9 @@ namespace GFGGame
|
|
|
SceneController.UpdateFightTarget(fightCfg.targetRes, _sceneObject);
|
|
|
_ui.m_selfName.m_txtName.text = RoleDataManager.roleName;
|
|
|
_ui.m_targetName.m_txtName.text = fightCfg.targetName;
|
|
|
+ _ui.m_btnSpeedUp.visible = EquipDataCache.cacher.autoPlay;
|
|
|
|
|
|
+ _speed = 1;
|
|
|
UpdateNormal();
|
|
|
AddEffect();
|
|
|
|
|
@@ -127,15 +132,24 @@ namespace GFGGame
|
|
|
{
|
|
|
_ui.m_btnSkill0.target.touchable = false;
|
|
|
}
|
|
|
- Timers.inst.Add(0.5f, 1, CircleScoreStart);//评分开始
|
|
|
+ Timers.inst.Add(0.5f / _speed, 1, CircleScoreStart);//评分开始
|
|
|
+
|
|
|
}
|
|
|
private void UpdateNormal()
|
|
|
{
|
|
|
Reset();
|
|
|
+
|
|
|
+
|
|
|
RoleSkillCfg[] roleSkillCfgs = RoleSkillCfgArray.Instance.dataArray;
|
|
|
for (int i = 0; i < roleSkillCfgs.Length; i++)
|
|
|
{
|
|
|
GComponent btnSkill = _ui.target.GetChild("btnSkill" + i).asCom;
|
|
|
+ if (EquipDataCache.cacher.autoPlay)
|
|
|
+ {
|
|
|
+ isAutoPlay = true;
|
|
|
+ btnSkill.touchable = EquipDataCache.cacher.autoPlay;
|
|
|
+ OnBtnSkillClick(btnSkill);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
private void AddEffect()
|
|
@@ -227,7 +241,11 @@ namespace GFGGame
|
|
|
_ui.m_comTargetCircle.m_t0.Play(1, 0, 0, 0.75f, null);
|
|
|
return;
|
|
|
}
|
|
|
+ _ui.m_comMineCircle.m_t0.ignoreEngineTimeScale = false;
|
|
|
+ _ui.m_comMineCircle.m_t0.timeScale = _speed;
|
|
|
_ui.m_comMineCircle.m_t0.Play(CircleScoreEnd);
|
|
|
+ _ui.m_comTargetCircle.m_t0.ignoreEngineTimeScale = false;
|
|
|
+ _ui.m_comTargetCircle.m_t0.timeScale = _speed;
|
|
|
_ui.m_comTargetCircle.m_t0.Play();
|
|
|
|
|
|
}
|
|
@@ -243,7 +261,7 @@ namespace GFGGame
|
|
|
{
|
|
|
_ui.m_comTargetCircle.target.visible = false;
|
|
|
_ui.m_comMineCircle.target.visible = false;
|
|
|
- Timers.inst.Add(0.5f, 1, CircleScoreStart);//评分结束
|
|
|
+ Timers.inst.Add(0.5f / _speed, 1, CircleScoreStart);//评分结束
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -252,6 +270,7 @@ namespace GFGGame
|
|
|
|
|
|
private void OnBtnSkillClick(GComponent obj)
|
|
|
{
|
|
|
+ if (EquipDataCache.cacher.autoPlay && !isAutoPlay) return;
|
|
|
UI_ComBtnSkill item = UI_ComBtnSkill.Proxy(obj);
|
|
|
RoleSkillCfg cfg = item.target.data as RoleSkillCfg;
|
|
|
int count = (int)item.m_icon.data;
|
|
@@ -267,16 +286,21 @@ namespace GFGGame
|
|
|
GProgressBar bar = item.m_proCD;
|
|
|
bar.visible = true;
|
|
|
bar.value = 100;
|
|
|
- bar.TweenValue(0, time).OnComplete((GTweener tweener) =>
|
|
|
- {
|
|
|
- GProgressBar bar1 = (GProgressBar)tweener.target;
|
|
|
- UI_ComBtnSkill item1 = UI_ComBtnSkill.Proxy(bar1.parent);
|
|
|
- int count = (int)item1.m_icon.data;
|
|
|
- RoleSkillCfg cfg = item1.target.data as RoleSkillCfg;
|
|
|
- item1.m_c1.selectedIndex = count >= cfg.limiteCount ? 2 : 0;
|
|
|
-
|
|
|
- item1.m_proCD.visible = false;
|
|
|
- });
|
|
|
+ bar.TweenValue(0, time / _speed).OnComplete((GTweener tweener) =>
|
|
|
+ {
|
|
|
+ GProgressBar bar1 = (GProgressBar)tweener.target;
|
|
|
+ UI_ComBtnSkill item1 = UI_ComBtnSkill.Proxy(bar1.parent);
|
|
|
+ int count = (int)item1.m_icon.data;
|
|
|
+ RoleSkillCfg cfg = item1.target.data as RoleSkillCfg;
|
|
|
+ item1.m_c1.selectedIndex = count >= cfg.limiteCount ? 2 : 0;
|
|
|
+
|
|
|
+ item1.m_proCD.visible = false;
|
|
|
+ if (EquipDataCache.cacher.autoPlay && isAutoPlay)
|
|
|
+ {
|
|
|
+ OnBtnSkillClick(item1.target);
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
private void SetSkillValue(RoleSkillCfg cfg, int role)
|
|
@@ -316,6 +340,8 @@ namespace GFGGame
|
|
|
}
|
|
|
// comRoleSkillScore.m_comRoleSkill.m_c1.selectedIndex = 0;
|
|
|
comRoleSkillScore.m_txtScore.SetVar("count", score.ToString()).FlushVars();
|
|
|
+ comRoleSkillScore.m_t0.ignoreEngineTimeScale = false;
|
|
|
+ comRoleSkillScore.m_t0.timeScale = _speed;
|
|
|
comRoleSkillScore.m_t0.Play(() =>
|
|
|
{
|
|
|
comRoleSkillScore.target.visible = false;
|
|
@@ -333,54 +359,57 @@ namespace GFGGame
|
|
|
|
|
|
comSkillMinus.visible = true;
|
|
|
comSkillMinus.value = 0;
|
|
|
- comSkillMinus.TweenValue(100, 2f).OnComplete(() =>
|
|
|
- {
|
|
|
- comSkillMinus.visible = false;
|
|
|
-
|
|
|
- if (targetComSkillShield.m_holder.visible)
|
|
|
- {
|
|
|
- targetComSkillShield.m_holder.visible = false;
|
|
|
- targetComSkillShield.m_holder1.visible = true;
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- UI_ComRoleSkill1 comRoleSkillScore = role == SkillDataManager.MINE ? _ui.m_ComRoleSkillNpcMinus : _ui.m_ComRoleSkillMineMinus;
|
|
|
- comRoleSkillScore.target.visible = true;
|
|
|
- comRoleSkillScore.m_c1.selectedIndex = role == SkillDataManager.MINE ? 0 : 1;
|
|
|
- int score = 0;
|
|
|
- if (role == SkillDataManager.MINE)
|
|
|
- {
|
|
|
- score = (int)_targetMainScore * cfg.value / 100;
|
|
|
- _targetScore -= score;
|
|
|
-
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- score = (int)_mainScore * cfg.value / 100;
|
|
|
- _score -= score;
|
|
|
- }
|
|
|
-
|
|
|
- // comRoleSkillScore.m_comRoleSkill.m_c1.selectedIndex = 1;
|
|
|
- comRoleSkillScore.m_txtScore.SetVar("count", score.ToString()).FlushVars();
|
|
|
- if (role == SkillDataManager.MINE)
|
|
|
- {
|
|
|
-
|
|
|
- comRoleSkillScore.m_t0.Play(() =>
|
|
|
- {
|
|
|
- comRoleSkillScore.target.visible = false;
|
|
|
- });
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- comRoleSkillScore.m_t1.Play(() =>
|
|
|
- {
|
|
|
- comRoleSkillScore.target.visible = false;
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- UpdateProgressBar();
|
|
|
-
|
|
|
- });
|
|
|
+ comSkillMinus.TweenValue(100, 2f / _speed).OnComplete(() =>
|
|
|
+ {
|
|
|
+ comSkillMinus.visible = false;
|
|
|
+
|
|
|
+ if (targetComSkillShield.m_holder.visible)
|
|
|
+ {
|
|
|
+ targetComSkillShield.m_holder.visible = false;
|
|
|
+ targetComSkillShield.m_holder1.visible = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ UI_ComRoleSkill1 comRoleSkillScore = role == SkillDataManager.MINE ? _ui.m_ComRoleSkillNpcMinus : _ui.m_ComRoleSkillMineMinus;
|
|
|
+ comRoleSkillScore.target.visible = true;
|
|
|
+ comRoleSkillScore.m_c1.selectedIndex = role == SkillDataManager.MINE ? 0 : 1;
|
|
|
+ int score = 0;
|
|
|
+ if (role == SkillDataManager.MINE)
|
|
|
+ {
|
|
|
+ score = (int)_targetMainScore * cfg.value / 100;
|
|
|
+ _targetScore -= score;
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ score = (int)_mainScore * cfg.value / 100;
|
|
|
+ _score -= score;
|
|
|
+ }
|
|
|
+
|
|
|
+ // comRoleSkillScore.m_comRoleSkill.m_c1.selectedIndex = 1;
|
|
|
+ comRoleSkillScore.m_txtScore.SetVar("count", score.ToString()).FlushVars();
|
|
|
+ if (role == SkillDataManager.MINE)
|
|
|
+ {
|
|
|
+ comRoleSkillScore.m_t0.ignoreEngineTimeScale = false;
|
|
|
+ comRoleSkillScore.m_t0.timeScale = _speed;
|
|
|
+ comRoleSkillScore.m_t0.Play(() =>
|
|
|
+ {
|
|
|
+ comRoleSkillScore.target.visible = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ comRoleSkillScore.m_t0.ignoreEngineTimeScale = false;
|
|
|
+ comRoleSkillScore.m_t0.timeScale = _speed;
|
|
|
+ comRoleSkillScore.m_t1.Play(() =>
|
|
|
+ {
|
|
|
+ comRoleSkillScore.target.visible = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ UpdateProgressBar();
|
|
|
+
|
|
|
+ });
|
|
|
}
|
|
|
private void UpdateBreakUI(RoleSkillCfg cfg, int role)
|
|
|
{
|
|
@@ -402,13 +431,19 @@ namespace GFGGame
|
|
|
comSkillShield.m_holder.visible = true;
|
|
|
comSkillShield.m_holder1.visible = false;
|
|
|
|
|
|
- Timers.inst.Add(cfg.duration, 1, (param) =>
|
|
|
- {
|
|
|
- // comSkillShield.target.visible = false;
|
|
|
- comSkillShield.m_holder.visible = false;
|
|
|
+ Timers.inst.Add(cfg.duration / _speed, 1, (param) =>
|
|
|
+ {
|
|
|
+ // comSkillShield.target.visible = false;
|
|
|
+ comSkillShield.m_holder.visible = false;
|
|
|
|
|
|
- });
|
|
|
+ });
|
|
|
}
|
|
|
+ private void OnBtnSpeedUp()
|
|
|
+ {
|
|
|
+ _speed = _speed == 1 ? 2 : 1;
|
|
|
+ _ui.m_btnSpeedUp.title = "x" + _speed;
|
|
|
+ }
|
|
|
+
|
|
|
private void OnBtnBackClick()
|
|
|
{
|
|
|
Reset();
|
|
@@ -471,7 +506,7 @@ namespace GFGGame
|
|
|
btnSkill.GetController("c1").selectedIndex = 0;
|
|
|
// btnSkill.GetTransition("t0").Stop();
|
|
|
}
|
|
|
-
|
|
|
+ isAutoPlay = false;
|
|
|
Timers.inst.Remove(CircleScoreStart);
|
|
|
Timers.inst.Remove(Skip);
|
|
|
}
|