浏览代码

单人战斗添加返回按钮

zhaoyang 3 年之前
父节点
当前提交
d46f311a58

+ 2 - 1
FGUIProject/assets/Main/StoryFightSingleScoreUI.xml

@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1080,1920" designImage="ui://mfvz4q8kuo1t9j" designImageOffsetY="-120">
   <displayList>
+    <component id="n34_tc53" name="btnBack" src="9xlo8" fileName="components/ButtonBack1.xml" pkg="eg2y0ldp" xy="52,142"/>
     <component id="n0_8xpg" name="selfScore" src="8xpg4e" fileName="components/CompFightScore.xml" xy="419,843" visible="false">
       <relation target="" sidePair="center-center,middle-middle"/>
     </component>
@@ -14,7 +15,7 @@
     <graph id="n27_uo1t" name="grh_5" xy="238,1579" pivot="0.5,0.5" size="25,25" aspect="true"/>
     <graph id="n28_uo1t" name="grh_6" xy="200,865" pivot="0.5,0.5" size="25,25" aspect="true"/>
     <graph id="n29_uo1t" name="grh_7" xy="782,389" pivot="0.5,0.5" size="25,25" aspect="true"/>
-    <component id="n33_vuz5" name="proScore" src="vuz5bh" fileName="components/ProgressBarSingleScore.xml" xy="79,1796">
+    <component id="n33_vuz5" name="proScore" src="vuz5bh" fileName="components/ProgressBar1.xml" xy="79,1796">
       <relation target="" sidePair="bottom-bottom"/>
       <ProgressBar max="100"/>
     </component>

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Main/UI_StoryFightSingleScoreUI.cs

@@ -7,6 +7,7 @@ namespace UI.Main
     public partial class UI_StoryFightSingleScoreUI
     {
         public GComponent target;
+        public GButton m_btnBack;
         public UI_CompFightScore m_selfScore;
         public UI_comClickCircle m_comClickCircle;
         public UI_ComAllCircle m_comAllCircle;
@@ -66,6 +67,7 @@ namespace UI.Main
 
         private void Init(GComponent comp)
         {
+            m_btnBack = (GButton)comp.GetChild("btnBack");
             m_selfScore = (UI_CompFightScore)UI_CompFightScore.Create(comp.GetChild("selfScore"));
             m_comClickCircle = (UI_comClickCircle)UI_comClickCircle.Create(comp.GetChild("comClickCircle"));
             m_comAllCircle = (UI_ComAllCircle)UI_ComAllCircle.Create(comp.GetChild("comAllCircle"));
@@ -81,6 +83,7 @@ namespace UI.Main
         }
         public void Dispose(bool disposeTarget = false)
         {
+            m_btnBack = null;
             m_selfScore.Dispose();
             m_selfScore = null;
             m_comClickCircle.Dispose();

+ 17 - 1
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightSingleScoreView.cs

@@ -29,6 +29,8 @@ namespace GFGGame
             isfullScreen = true;
 
             _scenePrefab = GFGAsset.Load<GameObject>(ResPathUtil.GetPrefabPath("SceneFightSingleScore"));
+            _ui.m_btnBack.onClick.Add(OnBtnBackClick);
+
         }
 
         protected override void OnShown()
@@ -219,7 +221,7 @@ namespace GFGGame
         private void SetScoreUI()
         {
             EquipDataCache.cacher.totalScore = (int)Math.Round(_score);
-            _ui.m_proScore.m_txtCount.text = Math.Round(_score).ToString();
+            _ui.m_proScore.m_txtCount.text = "总分:" + Math.Round(_score).ToString();
             _ui.m_proScore.target.TweenValue(_score, 0.2f);
 
         }
@@ -229,10 +231,24 @@ namespace GFGGame
             EventAgent.RemoveEventListener(ConstMessage.CARD_SKILL, CircleScoreStart);
             Timers.inst.Remove(SkillScoreStart);
             Timers.inst.Remove(Skip);
+            _ui.m_proScore.target.value = 0;
+            _ui.m_proScore.m_txtCount.text = "总分:0";
             this.Hide();
             ViewManager.Show(ViewName.STORY_FIGHT_RESULT_VIEW);
         }
+        private void OnBtnBackClick()
+        {
+            EventAgent.RemoveEventListener(ConstMessage.CARD_SKILL, CircleScoreStart);
+            Timers.inst.Remove(SkillScoreStart);
+            Timers.inst.Remove(Skip);
+            _ui.m_comAllCircle.target.visible = false;
+            _ui.m_proScore.target.value = 0;
+            _ui.m_proScore.m_txtCount.text = "总分:0";
 
+            this.Hide();
+            ViewManager.Show(ViewName.STORY_CHAPTER_VIEW, StoryDataManager.currentChapter, ViewManager.GetGoBackDatas(ViewName.STORY_CHAPTER_VIEW));
+
+        }
         protected override void OnHide()
         {
             base.OnHide();

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