浏览代码

修改礼物测试功能接口;礼物UI动画支持展示头像;修复点赞进度度显示bug

大爷 1 年之前
父节点
当前提交
85c6a52def

+ 2 - 2
Unity/Assets/Scripts/Codes/Hotfix/Client/battle/BattleMgr.cs

@@ -327,11 +327,11 @@ namespace ET
                 var msg = e.Message;
                 Log.Debug($">>>Battle event message: {msg}");
 
-                if (msg.StartsWith("item:"))
+                /*if (msg.StartsWith("item:"))
                 {
                     EventSystem.Instance.Publish(ShowUIAnimation.Clone(ShowUIAnimation.AniType.Gift, System.Convert.ToInt32(msg[5..])));
                 }
-                else if(msg.StartsWith("bosscome:"))
+                else*/ if(msg.StartsWith("bosscome:"))
                 {
                     EventSystem.Instance.Publish(ShowUIAnimation.Clone(ShowUIAnimation.AniType.Monster, System.Convert.ToInt32(msg[9..])));
                 }

+ 13 - 37
Unity/Assets/Scripts/Codes/Hotfix/Client/battle/BattleMgr_Cmd.cs

@@ -64,7 +64,7 @@ namespace ET
                         }).Coroutine();
                     }
                     break;
-                case (int)KeyCode.F2:
+                /*case (int)KeyCode.F2:
                     var units2 = new int[] { 102, 112, 122, 132 };
                     rand = new Random();
                     for (int i = 0; i < 2; i++)
@@ -93,52 +93,28 @@ namespace ET
                             Y = (int)pos.Y
                         }).Coroutine();
                     }
-                    break;
+                    break;*/
 
+                case (int)KeyCode.F2:
+                    session.Call(new C2G_BattleNotify() { Message = "test:1" }).Coroutine();
+                    break;
+                case (int)KeyCode.F3:
+                    session.Call(new C2G_BattleNotify() { Message = "test:2" }).Coroutine();
+                    break;
                 case (int)KeyCode.F4:
-                    session.Call(new C2G_BattleNotify()
-                    {
-                        Message = BattleNotify.TiktokGift_1.ToString()
-                    }).Coroutine();
+                    session.Call(new C2G_BattleNotify() { Message = "test:3" }).Coroutine();
                     break;
                 case (int)KeyCode.F5:
-                    session.Call(new C2G_BattleNotify()
-                    {
-                        Message = BattleNotify.TiktokGift_10.ToString()
-                    }).Coroutine();
+                    session.Call(new C2G_BattleNotify() { Message = "test:4" }).Coroutine();
                     break;
                 case (int)KeyCode.F6:
-                    session.Call(new C2G_BattleNotify()
-                    {
-                        Message = BattleNotify.TiktokGift_52.ToString()
-                    }).Coroutine();
+                    session.Call(new C2G_BattleNotify() { Message = "test:5" }).Coroutine();
                     break;
                 case (int)KeyCode.F7:
-                    session.Call(new C2G_BattleNotify()
-                    {
-                        Message = BattleNotify.TiktokGift_99.ToString()
-                    }).Coroutine();
+                    session.Call(new C2G_BattleNotify() { Message = "test:6" }).Coroutine();
                     break;
                 case (int)KeyCode.F8:
-                    session.Call(new C2G_BattleNotify()
-                    {
-                        Message = BattleNotify.TiktokGift_199.ToString()
-                    }).Coroutine();
-                    break;
-                case (int)KeyCode.F9:
-                    session.Call(new C2G_BattleNotify()
-                    {
-                        Message = BattleNotify.TiktokGift_520.ToString()
-                    }).Coroutine();
-                    break;
-                case (int)KeyCode.F10:
-                    session.Call(new C2G_BattleNotify()
-                    {
-                        Message = BattleNotify.TiktokLike_energy.ToString()
-                    }).Coroutine();
-                    break;
-                case (int)KeyCode.F11:
-                    EventSystem.Instance.Publish(ShowVipName.Clone(8));
+                    session.Call(new C2G_BattleNotify() { Message = "test:7" }).Coroutine();
                     break;
                 
             }

+ 2 - 1
Unity/Assets/Scripts/Codes/Hotfix/Client/battle/GameServer/TiktokPushHandler.cs

@@ -8,7 +8,7 @@ namespace ET.Client
     {
         protected override async ETTask Run(Session session, G2C_LikeInfoPush a)
         {
-            EventSystem.Instance.Publish(ShowUIAnimation.Clone(ShowUIAnimation.AniType.LikeEnergy, (int)(a.ConfigNum * 100 / a.TotalNum)));
+            EventSystem.Instance.Publish(ShowUIAnimation.Clone(ShowUIAnimation.AniType.LikeEnergy, (int)(a.TotalNum * 100 / a.ConfigNum)));
             await ETTask.CompletedTask;
         }
     }
@@ -25,6 +25,7 @@ namespace ET.Client
                 //花了钱,就可以显示大名
                 EventSystem.Instance.Publish(ShowVipName.Clone((uint)a.UnitId));
             }
+
             await ETTask.CompletedTask;
         }
     }

+ 19 - 12
Unity/Assets/Scripts/Codes/HotfixView/Client/UI/HUD/CreateHUD.cs

@@ -202,19 +202,8 @@ namespace ET.Client
 
             switch(a.Type)
             {
-                case ShowUIAnimation.AniType.Gift:
-                    var trans = view.GetTransition($"t_gift_00{a.Param1}");
-                    if (trans != null)
-                    {
-                        trans.Play();
-                    }
-                    else
-                    {
-                        Log.Error($"NotFound UIAni: {a.Type},{a.Param1}");
-                    }
-                    break;
                 case ShowUIAnimation.AniType.Monster:
-                    trans = view.GetTransition("t_warning");
+                    var trans = view.GetTransition("t_warning");
                     trans.Play();
 
                     trans = view.GetTransition($"t_warning_00{a.Param1}");
@@ -259,6 +248,13 @@ namespace ET.Client
             var comp = HUDComonent.listGift[a.index - 1];
             comp.GetChild("Text1").text = a.nickname;
             comp.GetChild("Text2").text = "X" + a.num;
+            var mask = comp.GetChild("n0").asCom;
+            var icon = mask.GetChild("iconLoader").asLoader;
+            var url = a.avatar;
+            if (!string.IsNullOrEmpty(url))
+            {
+                LoadHeadIcon(icon, url).Coroutine();
+            }
             var trans = HUDComonent.Root.GetTransition($"t_gift_00{a.index}");
             if (trans != null)
             {
@@ -266,6 +262,17 @@ namespace ET.Client
             }
             await ETTask.CompletedTask;
         }
+        private async ETTask LoadHeadIcon(GLoader loader, string url)
+        {
+            var tex = await UrlImageLoader.Instance.LoadImage(url);
+            if (tex != null)
+            {
+                if (GRoot.inst.GetChild("HUD") != null)
+                {
+                    loader.texture = new NTexture(tex);
+                }
+            }
+        }
     }
     [Event]
     public class ShowOrHideHeadBarHandler : BEvent<ShowOrHideHeadBar>

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

@@ -300,7 +300,6 @@ namespace ET
         {
             public enum AniType
             {
-                Gift,
                 Monster,
                 Tower,
                 LikeEnergy