大爷 1 жил өмнө
parent
commit
62d008ee5f

BIN
Unity/Assets/Res/FGUI/CommonDialog_atlas0.png


BIN
Unity/Assets/Res/FGUI/CommonDialog_atlas0_1.png


BIN
Unity/Assets/Res/FGUI/CommonDialog_fui.bytes


BIN
Unity/Assets/Res/FGUI/paiming_atlas0.png


+ 1 - 1
Unity/Assets/Res/FGUI/CommonDialog_atlas0_1.png.meta → Unity/Assets/Res/FGUI/paiming_atlas0.png.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 5fe7ad98287ed454e86c03dbf040a702
+guid: 08f5a77428ef2724cb7302b17abd6432
 TextureImporter:
   internalIDToNameTable: []
   externalObjects: {}

BIN
Unity/Assets/Res/FGUI/paiming_fui.bytes


+ 7 - 0
Unity/Assets/Res/FGUI/paiming_fui.bytes.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 668f35d9f23d14a44b1b58cc290dde5c
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 0 - 0
Unity/Assets/Scripts/Codes/Hotfix/Client/battle/TiktokPushHandler.cs → Unity/Assets/Scripts/Codes/Hotfix/Client/battle/GameServer/TiktokPushHandler.cs


+ 0 - 0
Unity/Assets/Scripts/Codes/Hotfix/Client/battle/TiktokPushHandler.cs.meta → Unity/Assets/Scripts/Codes/Hotfix/Client/battle/GameServer/TiktokPushHandler.cs.meta


+ 71 - 8
Unity/Assets/Scripts/Codes/HotfixView/Client/Battle/GameoverHanler.cs

@@ -1,28 +1,91 @@
 using ET.Client;
+using ET.EventType;
+using FairyGUI;
+using System.Collections.Generic;
 using UnityEngine;
 
 namespace ET
 {
+    [Event]
+    public class RankEventHandler : BEvent<RankChangeEvent>
+    {
+        protected override async ETTask OnEvent(RankChangeEvent a)
+        {
+            GameoverEventHandler.RankList = a.InfoList;
+            await ETTask.CompletedTask;
+        }
+    }
+
     [Event]
     public class GameoverEventHandler : BEvent<EventType.GameoverEvent>
     {
+        public static List<RankInfo> RankList = new();
+        public static bool IsGameOver = false;
+
         protected override async ETTask OnEvent(EventType.GameoverEvent args)
         {
-            string title = "";
-            string content = "";
+            IsGameOver = true;
+            GComponent view;
             if(args.winForce == 1)
             {
-                title = "守护成功";
-                content = "感谢榜上大哥的钞能力,成功守护了家园";
+                view = await UIHelper.Create("CommonDialog", "GameoverSuccess");
             }
             else
             {
-                title = "守护失败";
-                content = "大哥不给力啊";
+                view = await UIHelper.Create("CommonDialog", "GameoverFailed");
             }
-            await UICommonDialog1.Show(title, content, () => {
 
-            }, null);
+            //等1秒,等排行榜数据
+            await TimerComponent.Instance.WaitAsync(1000);
+
+            view.GetChild("btn_ok").onClick.Set(async () =>
+            {
+                GRoot.inst.RemoveChild(view);
+
+                view = await UIHelper.Create("paiming", "paiming");
+                InitRankView(view);
+                view.GetChild("btn_ok").onClick.Set(() =>
+                {
+                    RankList = null;
+                    IsGameOver = false;
+
+                    GRoot.inst.RemoveChild(view);
+                    EventSystem.Instance.Publish<ReOpenGame>();
+                });
+            });
+        }
+
+        //展示排行榜
+        private void InitRankView(GComponent view)
+        {
+            var list = view.GetChild("list").asList;
+            var data = RankList;
+
+            int i = 0;
+            for (; i < data.Count; i++)
+            {
+                var chd = list.GetChildAt(i).asCom;
+                if (chd == null)
+                {
+                    chd = UIPackage.CreateObject("paiming", $"paiminsg_0{((i<3) ? (i+1) : 4)}").asCom;
+                    list.AddChild(chd);
+                }
+                else
+                {
+                    chd.visible = true;
+                }
+
+                if(i >= 3)
+                {
+                    chd.GetChild("rank").text = (i + 1).ToString();
+                }
+                chd.GetChild("name").text = data[i].Name;
+                chd.GetChild("score").text = data[i].Value.ToString();
+            }
+            for (; i < list.numChildren; i++)
+            {
+                list.GetChildAt(i).visible = false;
+            }
         }
     }
 }

+ 2 - 3
Unity/Assets/Scripts/Codes/HotfixView/Client/UI/HUD/CreateHUD.cs

@@ -130,13 +130,12 @@ namespace ET.Client
             if(list.visible)
             {
                 int i = 0;
-                for (; i<a.InfoList.Count; i++)
+                for (; i < a.InfoList.Count; i++)
                 {
                     var chd = list.GetChildAt(i).asCom;
                     if(chd == null)
                     {
-                        Log.Error($"rank list child not exist: {i}");
-                        continue;
+                        return;
                     }
                     var txt = chd.GetChild("text");
                     txt.text = a.InfoList[i].Name;

+ 2 - 0
Unity/Assets/Scripts/Codes/Model/Client/EventTypeClient.cs

@@ -360,5 +360,7 @@ namespace ET
                 return Static;
             }
         }
+
+        public class ReOpenGame { }
     }
 }