浏览代码

战斗表现

zhaoyang 3 年之前
父节点
当前提交
8ef5548b31

+ 4 - 7
FGUIProject/assets/Main/components/ProgressBar1.xml

@@ -1,14 +1,11 @@
 <?xml version="1.0" encoding="utf-8"?>
-<component size="836,45" extention="ProgressBar">
+<component size="836,43" extention="ProgressBar">
   <displayList>
-    <image id="n0_vuz5" name="n0" src="v3k9cq" fileName="imagesStory/zd_zdjdt_1.png" xy="-17,0" size="870,49">
+    <image id="n0_vuz5" name="n0" src="v3k9cq" fileName="imagesStory/zd_zdjdt_1.png" xy="-17,0">
       <relation target="" sidePair="width-width,height-height"/>
     </image>
-    <image id="n1_vuz5" name="bar" src="v3k9cr" fileName="imagesStory/zd_zdjdt_2.png" xy="0,10"/>
-    <text id="n2_vuz5" name="txtCount" xy="32,-4" size="126,51" font="ui://eg2y0ldpk1kha2" fontSize="26" color="#fff6ee" vAlign="middle" autoSize="none" text="总分:0"/>
-    <image id="n3_vuz5" name="ani" src="vuz5bc" fileName="imagesStory/zd_pfjdt_3.png" xy="818,-7">
-      <relation target="n1_vuz5" sidePair="right-right"/>
-    </image>
+    <component id="n5_rlp9" name="comBar" src="k1khe7" fileName="components/Component2.xml" xy="0,9"/>
+    <text id="n2_vuz5" name="txtCount" xy="32,3" size="94,36" font="ui://eg2y0ldpk1kha2" fontSize="26" color="#fff6ee" vAlign="middle" text="总分:0"/>
     <image id="n4_oixc" name="imgFirstScore" src="oixcby" fileName="imagesStory/zd_pfjdt_4.png" xy="-12,-4"/>
   </displayList>
   <ProgressBar titleType="value"/>

+ 4 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Main/UI_ProgressBar1.cs

@@ -7,6 +7,7 @@ namespace UI.Main
     public partial class UI_ProgressBar1
     {
         public GProgressBar target;
+        public UI_Component2 m_comBar;
         public GTextField m_txtCount;
         public GImage m_imgFirstScore;
         public const string URL = "ui://mfvz4q8kvuz5bh";
@@ -56,11 +57,14 @@ namespace UI.Main
 
         private void Init(GComponent comp)
         {
+            m_comBar = (UI_Component2)UI_Component2.Create(comp.GetChild("comBar"));
             m_txtCount = (GTextField)comp.GetChild("txtCount");
             m_imgFirstScore = (GImage)comp.GetChild("imgFirstScore");
         }
         public void Dispose(bool disposeTarget = false)
         {
+            m_comBar.Dispose();
+            m_comBar = null;
             m_txtCount = null;
             m_imgFirstScore = null;
             if(disposeTarget && target != null)

+ 14 - 3
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightSingleScoreView.cs

@@ -23,6 +23,7 @@ namespace GFGGame
         private float _playTime = 1.25f;
 
         private GameObject _gameObject0;
+        private GameObject _gameObject1;
 
         protected override void OnInit()
         {
@@ -61,7 +62,7 @@ namespace GFGGame
             StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(InstanceZonesDataManager.currentLevelCfgId);
             StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
             _ui.m_proScore.target.max = fightCfg.score3;
-            _ui.m_proScore.target.value = 0;
+            _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;
 
             _index = 0;
@@ -249,8 +250,15 @@ namespace GFGGame
         {
             EquipDataCache.cacher.totalScore = (int)Math.Round(_score);
             _ui.m_proScore.m_txtCount.text = "总分:" + Math.Round(_score).ToString();
-            _ui.m_proScore.target.TweenValue(_score, 0.2f);
+            // _ui.m_proScore.target.TweenValue(_score, 0.2f);
 
+            double proportion = _score / _ui.m_proScore.target.max;//(_score + _ui.m_proScore.target.max) > 0 ? _score / (_score + _ui.m_proScore.target.max) : 0;
+            float width = (float)(proportion * _ui.m_proScore.target.width);
+            width = width > _ui.m_proScore.m_comBar.target.initWidth ? _ui.m_proScore.m_comBar.target.initWidth : width;
+            GTween.To(_ui.m_proScore.m_comBar.target.width, width, 0.5f).SetTarget(_ui.m_proScore.m_comBar).OnUpdate((GTweener t) =>
+                {
+                    _ui.m_proScore.m_comBar.target.width = t.value.x;
+                }); ;
         }
         private void OnBtnSpeedUp()
         {
@@ -285,7 +293,7 @@ namespace GFGGame
         private void PlayScoreTWEffect()
         {
             _ui.m_holderPartScore.visible = true;
-            Vector3 endVaule = _ui.m_proScore.target.GetChild("ani").asImage.LocalToGlobal(Vector2.zero);
+            Vector3 endVaule = _ui.m_proScore.target.position + new Vector3(_ui.m_proScore.m_comBar.target.width, 0, 0);
             GTween.To(_ui.m_comClickCircle.target.position, endVaule, 0.5f).SetTarget(_ui.m_holderPartScore).OnUpdate((GTweener t) =>
             {
                 _ui.m_holderPartScore.position = t.value.vec2;
@@ -299,6 +307,8 @@ namespace GFGGame
         {
             string resPath0 = ResPathUtil.GetViewEffectPath("ui_zhandou", "zd_df_tw");
             SceneController.AddObjectToView(_gameObject0, null, _ui.m_holderPartScore, resPath0, out _gameObject0, out GoWrapper _wrapper0);
+            string resPath1 = ResPathUtil.GetViewEffectPath("ui_zhandou", "ui_zd_jdt");
+            SceneController.AddObjectToView(_gameObject1, null, _ui.m_proScore.m_comBar.m_holder, resPath1, out _gameObject1, out GoWrapper _wrapper6);
         }
         protected override void OnHide()
         {
@@ -319,6 +329,7 @@ namespace GFGGame
                 _scenePrefab = null;
             }
             SceneController.DestroyObjectFromView(_gameObject0);
+            SceneController.DestroyObjectFromView(_gameObject1);
 
             base.Dispose();
 

二进制
GameClient/Assets/ResIn/UI/Main/Main_atlas0!a.png


二进制
GameClient/Assets/ResIn/UI/Main/Main_atlas0.png


二进制
GameClient/Assets/ResIn/UI/Main/Main_atlas0_1!a.png


二进制
GameClient/Assets/ResIn/UI/Main/Main_atlas0_1.png


二进制
GameClient/Assets/ResIn/UI/Main/Main_atlas0_2.png


二进制
GameClient/Assets/ResIn/UI/Main/Main_atlas0_3!a.png


二进制
GameClient/Assets/ResIn/UI/Main/Main_atlas0_3.png


二进制
GameClient/Assets/ResIn/UI/Main/Main_atlas0_4!a.png


二进制
GameClient/Assets/ResIn/UI/Main/Main_atlas0_4.png


二进制
GameClient/Assets/ResIn/UI/Main/Main_fui.bytes