浏览代码

战斗结算

zhaoyang 2 年之前
父节点
当前提交
24bb006c4a

+ 4 - 3
GameClient/Assets/Game/HotUpdate/ServerProxy/InstanceZonesSProxy.cs

@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using ET;
+using FairyGUI;
 
 namespace GFGGame
 {
@@ -61,7 +62,7 @@ namespace GFGGame
         }
 
         //完成剧情战斗关卡
-        public static async ETTask FinishStoryFightLevel(int levelCfgId, int score, int npcScore, bool useRecomend)
+        public static async ETTask FinishStoryFightLevel(int levelCfgId, int score, int npcScore, bool useRecomend, NTexture nTexture)
         {
             M2C_FinishInstanceZonesFightLevel response = null;
             response = (M2C_FinishInstanceZonesFightLevel)await MessageHelper.SendToServer(new C2M_FinishInstanceZonesFightLevel()
@@ -95,14 +96,14 @@ namespace GFGGame
                         isFirstFinish = true;
                     }
                     InstanceZonesDataManager.TrySetLevelPass(response.LevelCfgId);
-                    ViewManager.Show(ViewName.STORY_FIGHT_RESULT_VIEW, new StoryFightResultData
+                    ViewManager.Show(ViewName.STORY_FIGHT_RESULT_VIEW, new object[] {new StoryFightResultData
                     {
                         Result = true,
                         Score = response.Score,
                         FirstPass = response.HasOnceBonus,
                         Star = response.Star,
                         BonusList = bonusList
-                    }, null, true);
+                    },nTexture}, null, true);
                     if (response.HasOnceBonus)
                     {
                         FunctionOpenDataManager.Instance.CheckHasChapterFunOpen(response.LevelCfgId);

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Views/DressUp/DressUpFightView.cs

@@ -460,11 +460,11 @@ namespace GFGGame
 
             if (hasFightTarget)
             {
-                ViewManager.Show(ViewName.STORY_FIGHT_TARGET_VIEW);
+                ViewManager.Show(ViewName.STORY_FIGHT_TARGET_VIEW, nTexture);
             }
             else
             {
-                ViewManager.Show(ViewName.STORY_FIGHT_SINGLE_VIEW);
+                ViewManager.Show(ViewName.STORY_FIGHT_SINGLE_VIEW, nTexture);
             }
             this.Hide();
 

+ 5 - 4
GameClient/Assets/Game/HotUpdate/Views/MainStory/InstanceZonesController.cs

@@ -1,4 +1,5 @@
 using ET;
+using FairyGUI;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -55,7 +56,7 @@ namespace GFGGame
 
 
 
-        public static async ETTask CheckStoryFightResult()
+        public static async ETTask CheckStoryFightResult(NTexture nTexture)
         {
             StoryLevelCfg storyLevelCfg = StoryLevelCfgArray.Instance.GetCfg(InstanceZonesDataManager.currentLevelCfgId);
             if (storyLevelCfg.type == ConstInstanceZonesType.Studio && storyLevelCfg.subType == ConstInstanceZonesSubType.Hard3)
@@ -70,17 +71,17 @@ namespace GFGGame
             var success = InstanceZonesDataManager.GetFightResult(score, out var npcScore);
             if (success)
             {
-                await InstanceZonesSProxy.FinishStoryFightLevel(InstanceZonesDataManager.currentLevelCfgId, score, npcScore, InstanceZonesDataManager.usedRecommend);
+                await InstanceZonesSProxy.FinishStoryFightLevel(InstanceZonesDataManager.currentLevelCfgId, score, npcScore, InstanceZonesDataManager.usedRecommend,nTexture);
             }
             else
             {
-                ViewManager.Show(ViewName.STORY_FIGHT_RESULT_VIEW, new StoryFightResultData
+                ViewManager.Show(ViewName.STORY_FIGHT_RESULT_VIEW, new object[]{ new StoryFightResultData
                 {
                     Result = false,
                     Score = score,
                     FirstPass = false,
                     Star = 0
-                }, null, true);
+                },nTexture}, null, true);
                 //失败仅判断并更新最高分
                 if (score > InstanceZonesDataManager.GetScoreHighest(InstanceZonesDataManager.currentCardId))
                 {

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

@@ -79,7 +79,7 @@ namespace GFGGame
             ScoreSystemData.Instance.SetEquipDicWithType();
 
             _ui.m_comClickCircle.target.touchable = false;
-            _ui.m_loaRole.texture = EquipDataCache.cacher.nTexture;
+            _ui.m_loaRole.texture = this.viewData as NTexture;
             // _ui.m_loaRole.SetSize(_ui.m_loaRole.width, _ui.m_loaRole.texture.height * _ui.m_loaRole.width / _ui.m_loaRole.texture.width);
 
             _ui.m_btnSpeedUp.visible = EquipDataCache.cacher.autoPlay;
@@ -251,7 +251,7 @@ namespace GFGGame
         {
             // Reset();
 
-            InstanceZonesController.CheckStoryFightResult().Coroutine();
+            InstanceZonesController.CheckStoryFightResult(this.viewData as NTexture).Coroutine();
         }
         private void OnBtnBackClick()
         {

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightSingleView.cs

@@ -55,10 +55,11 @@ namespace GFGGame
                 MusicManager.Instance.Play(ResPathUtil.GetMusicPath(fightCfg.music, "mp3"));
             }
             _ui.m_roleName.m_txtName.text = RoleDataManager.roleName;
+            NTexture nTexture = this.viewData as NTexture;
             Timers.inst.Add(0.9f, 1, (object param) =>
             {
                 this.Hide();
-                ViewManager.Show(ViewName.STORY_FIGHT_SINGLE_SCORE_VIEW);
+                ViewManager.Show(ViewName.STORY_FIGHT_SINGLE_SCORE_VIEW, nTexture);
             });
         }
 

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

@@ -697,7 +697,7 @@ namespace GFGGame
         }
         private void Skip(object param = null)
         {
-            InstanceZonesController.CheckStoryFightResult().Coroutine();
+            InstanceZonesController.CheckStoryFightResult(this.viewData as NTexture).Coroutine();
         }
         private void Reset()
         {

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryFightTargetView.cs

@@ -58,10 +58,11 @@ namespace GFGGame
             }
             _ui.m_roleName.m_txtName.text = RoleDataManager.roleName;
             _ui.m_targetName.m_txtName.text = fightCfg.targetName;
+            NTexture nTexture = this.viewData as NTexture;
             Timers.inst.Add(1.1f, 1, (object param) =>
             {
                 this.Hide();
-                ViewManager.Show(ViewName.STORY_FIGHT_TARGET_SCORE_VIEW);
+                ViewManager.Show(ViewName.STORY_FIGHT_TARGET_SCORE_VIEW, nTexture);
             });
         }
 

+ 3 - 2
GameClient/Assets/Game/HotUpdate/Views/MainStory/StroyFightResultView.cs

@@ -72,15 +72,16 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-            _resultData = (StoryFightResultData)this.viewData;
+            _resultData = (StoryFightResultData)(this.viewData as object[])[0];
 
             InstanceZonesDataManager.usedRecommend = false;
             InstanceZonesDataManager.isResultFighting = true;
 
             _ui.m_ComRoleResult.m_c1.selectedIndex = _resultData.Star;
 
+            NTexture nTexture = (this.viewData as object[])[1] as NTexture;
             GLoader loaRole = _ui.m_ComRoleResult.m_comRole.m_loaRole;
-            loaRole.texture = EquipDataCache.cacher.nTexture;
+            loaRole.texture = nTexture;
             loaRole.alpha = 1;
 
             // loaRole.SetSize(loaRole.width, loaRole.texture.height * loaRole.width / loaRole.texture.width);