Эх сурвалжийг харах

单人战斗,外圈收缩至与判定圆边缘重合时开始评分

zhaoyang 3 жил өмнө
parent
commit
b1ddce348b

+ 12 - 5
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightSingleScoreView.cs

@@ -18,9 +18,11 @@ namespace GFGGame
         private double _mainScore;//总主属性分
         private int _prefectCount = 0;//卓越点击数量
         private const int _range = 100;//圆圈随机范围
+        private const float _prefectScale = 60f;//完美缩放比
         private float _time = 0;// 登峰造极按住的时间
 
         private float _playTime = 2.3f;
+        private bool _stopFight = false;
 
         private GameObject _gameObject0;
         private GameObject _gameObject1;
@@ -74,6 +76,7 @@ namespace GFGGame
             _ui.m_proScore.m_comBar.target.width = 0;
             _ui.m_proScore.m_imgFirstScore.x = (((float)fightCfg.score1 / (float)fightCfg.score3)) * _ui.m_proScore.target.width;
 
+            _stopFight = false;
             _index = 0;
             _score = 0;
             _prefectCount = 0;
@@ -92,6 +95,7 @@ namespace GFGGame
 
         private void SkillScoreStart(object param)
         {
+            if (_stopFight) return;
             Debug.Log("_index:" + _index + "   length:" + FightScoreCfgArray.Instance.dataArray.Length);
             int partId = FightScoreCfgArray.Instance.dataArray[_index].id;
             _ui.m_comClickCircle.m_txtPart.text = FightScoreCfgArray.Instance.GetCfg(_index + 1).name;
@@ -127,7 +131,7 @@ namespace GFGGame
                 _ui.m_comClickCircle.target.touchable = false;
                 _ui.m_comClickCircle.m_loaCircle.touchable = false;
 
-                GTween.To(100, 60, _playTime / 2).SetTarget(_gameObject7).OnUpdate((GTweener t) =>
+                GTween.To(100, _prefectScale, _playTime / 2).SetTarget(_gameObject7).OnUpdate((GTweener t) =>
                 {
                     _gameObject7.transform.localScale = new Vector3(t.value.x, t.value.x, t.value.x);
                 });
@@ -137,9 +141,11 @@ namespace GFGGame
 
                 _ui.m_comClickCircle.m_grpCircle.visible = true;
                 _ui.m_comClickCircle.m_c1.selectedIndex = 0;
-                GTween.To(100, 0, _playTime / EquipDataCache.cacher.fightSpeed).SetTarget(_gameObject7).OnUpdate((GTweener t) =>
+                float scale = EquipDataCache.cacher.autoPlay ? _prefectScale : 0;
+                float time = (1 - scale / 100f) * _playTime / EquipDataCache.cacher.fightSpeed;
+                GTween.To(100, scale, time).SetTarget(_gameObject7).OnUpdate((GTweener t) =>
                 {
-                    if (t.value.x <= 60 && _ui.m_comClickCircle.m_c1.selectedIndex == 0)
+                    if (t.value.x <= _prefectScale && _ui.m_comClickCircle.m_c1.selectedIndex == 0)
                     {
                         _ui.m_comClickCircle.m_c1.selectedIndex = 1;
                     }
@@ -300,6 +306,7 @@ namespace GFGGame
         }
         private void Reset()
         {
+            _stopFight = true;
             EventAgent.RemoveEventListener(ConstMessage.CARD_SKILL, CircleScoreStart);
             Timers.inst.Remove(SkillScoreStart);
             Timers.inst.Remove(Skip);
@@ -386,7 +393,7 @@ namespace GFGGame
             {
                 return ScoreSystemData.PREFACT_CLICK;
             }
-            if (scaleX <= 60f && scaleX > 40f)
+            if (scaleX <= _prefectScale && scaleX > 40f)
             {
                 clickState = ScoreSystemData.PREFACT_CLICK;
                 _prefectCount++;
@@ -408,7 +415,7 @@ namespace GFGGame
             if (!ViewManager.CheckIsTopView(this.viewCom)) return;
 
             float scaleX = _gameObject7.transform.localScale.x;
-            if (scaleX == 60)
+            if (scaleX == _prefectScale)
             {
                 bool isGuide = GuideController.TryGuide(_ui.m_comClickCircle.target, ConstGuideId.SINGLE_FIGHT, 6, "服饰比较繁琐,适当的整理会更加分,点击为各部位修整吧");
                 if (isGuide)