فهرست منبع

修改HUD血条样式,使用按键代替功能按钮;增加事件弹幕展示;修改出兵位置范围

大爷 1 سال پیش
والد
کامیت
67c910d5e8

+ 6 - 0
FGUIProject/assets/HUD/CompMsg.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="760,56">
+  <displayList>
+    <richtext id="n0_mqh5" name="text" xy="0,1" size="760,56" font="Microsoft YaHei" fontSize="30" color="#99ffff" align="right" autoSize="shrink" text=""/>
+  </displayList>
+</component>

+ 24 - 19
FGUIProject/assets/HUD/HUD.xml

@@ -4,42 +4,47 @@
     <image id="n0_vcrv" name="bg_direction" src="vcrv8b" fileName="bg_direction.png" xy="4,1376" group="n5_vcrv" visible="false"/>
     <image id="n1_vcrv" name="img_direction" src="vcrv8c" fileName="img_direction.png" xy="73,1445" group="n5_vcrv" visible="false"/>
     <group id="n5_vcrv" name="wheel" xy="4,1376" size="218,218"/>
-    <component id="n8_pzlz" name="btn_skill2" src="pzlz8d" fileName="Button1.xml" xy="693,1354" group="n10_pzlz" visible="false"/>
-    <component id="n9_pzlz" name="btn_skill1" src="pzlz8e" fileName="Button2.xml" xy="572,1410" group="n10_pzlz" visible="false"/>
-    <group id="n10_pzlz" name="skillbtns" xy="572,1354" size="321,156"/>
-    <component id="n16_o3v3" name="btn_func1" src="o3v38i" fileName="Button3.xml" xy="895,1340" group="n14_o3v3">
+    <component id="n16_o3v3" name="btn_func1" src="o3v38i" fileName="Button3.xml" xy="1308,1412" group="n14_o3v3" visible="false">
       <Button title="显/隐血条" titleColor="#000000"/>
     </component>
-    <component id="n17_o3v3" name="btn_func2" src="o3v38i" fileName="Button3.xml" xy="895,1420" size="220,70" group="n14_o3v3">
+    <component id="n17_o3v3" name="btn_func2" src="o3v38i" fileName="Button3.xml" xy="1308,1492" size="220,70" group="n14_o3v3" visible="false">
       <Button title="摇人"/>
     </component>
-    <component id="n18_o3v3" name="btn_func3" src="o3v38i" fileName="Button3.xml" xy="895,1649" size="220,70" group="n14_o3v3">
+    <component id="n18_o3v3" name="btn_func3" src="o3v38i" fileName="Button3.xml" xy="1308,1721" size="220,70" group="n14_o3v3" visible="false">
       <Button title="范围加血"/>
     </component>
-    <component id="n19_o3v3" name="btn_func4" src="o3v38i" fileName="Button3.xml" xy="895,1492" size="220,70" group="n14_o3v3">
+    <component id="n19_o3v3" name="btn_func4" src="o3v38i" fileName="Button3.xml" xy="1308,1564" size="220,70" group="n14_o3v3" visible="false">
       <Button title="摇人2"/>
     </component>
-    <component id="n20_icx3" name="btn_mute" src="icx38n" fileName="Button4.xml" xy="898,1256" group="n14_o3v3">
+    <component id="n20_icx3" name="btn_mute" src="icx38n" fileName="Button4.xml" xy="1311,1328" group="n14_o3v3" visible="false">
       <Button title="Mute"/>
     </component>
-    <component id="n27_hth0" name="btn_func5" src="o3v38i" fileName="Button3.xml" xy="895,1564" group="n14_o3v3">
+    <component id="n27_hth0" name="btn_func5" src="o3v38i" fileName="Button3.xml" xy="1308,1636" group="n14_o3v3" visible="false">
       <Button title="遥人3"/>
     </component>
-    <image id="n13_uy5h" name="n13" src="uy5h8h" fileName="png_kpzlxbg.png" xy="876,1265" size="34,715" group="n14_o3v3"/>
-    <group id="n14_o3v3" name="TestBtns" xy="876,1256" size="242,724"/>
-    <component id="n21_tjcv" name="progressbar_1" src="tjcv8p" fileName="ProgressBar1.xml" xy="10,392">
-      <ProgressBar max="100"/>
-    </component>
-    <component id="n22_tjcv" name="progressbar_2" src="tjcv8r" fileName="ProgressBar2.xml" xy="710,391">
-      <ProgressBar max="100"/>
-    </component>
-    <text id="n25_tjcv" name="txt_hp1" xy="16,435" size="400,42" fontSize="30" color="#0ceed8" align="center" vAlign="middle" autoSize="none" bold="true" text="30%"/>
-    <text id="n26_tjcv" name="txt_hp2" xy="711,435" size="400,42" fontSize="30" color="#f85800" align="center" vAlign="middle" autoSize="none" bold="true" text="30%"/>
+    <image id="n13_uy5h" name="n13" src="uy5h8h" fileName="png_kpzlxbg.png" xy="1289,1337" size="34,715" group="n14_o3v3" visible="false"/>
+    <group id="n14_o3v3" name="TestBtns" xy="1289,1328" size="242,724"/>
     <list id="n28_hp1l" name="list_rank" xy="47,500" size="328,300" visible="false" selectionMode="none" overflow="scroll">
       <item url="ui://lk5vtytmhp1l8t"/>
       <item url="ui://lk5vtytmhp1l9d"/>
       <item url="ui://lk5vtytmhp1l9e"/>
     </list>
+    <component id="n29_mqh5" name="HPBar1" src="mqh59i" fileName="ProgressBar3.xml" xy="47,248">
+      <ProgressBar value="50" max="100"/>
+    </component>
+    <component id="n30_mqh5" name="HPBar2" src="mqh59j" fileName="ProgressBar4.xml" xy="819,248">
+      <ProgressBar value="50" max="100"/>
+    </component>
+    <list id="n31_mqh5" name="InfoList" xy="355,1330" size="760,491" overflow="scroll" align="right">
+      <item url="ui://lk5vtytmmqh59k"/>
+      <item url="ui://lk5vtytmmqh59k"/>
+      <item url="ui://lk5vtytmmqh59k"/>
+      <item url="ui://lk5vtytmmqh59k"/>
+      <item url="ui://lk5vtytmmqh59k"/>
+      <item url="ui://lk5vtytmmqh59k"/>
+      <item url="ui://lk5vtytmmqh59k"/>
+      <item url="ui://lk5vtytmmqh59k"/>
+    </list>
   </displayList>
   <Button downEffect="dark" downEffectValue=".71"/>
 </component>

+ 14 - 0
FGUIProject/assets/HUD/ProgressBar3.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="256,256" extention="ProgressBar">
+  <displayList>
+    <image id="n3_mqh5" name="n3" src="hp1l93" fileName="阴影底板.png" xy="0,0"/>
+    <image id="n0_mqh5" name="n0" src="hp1l92" fileName="血条外框.png" xy="0,0" size="256,256">
+      <relation target="" sidePair="width-width,height-height"/>
+    </image>
+    <image id="n1_mqh5" name="bar" src="hp1l8z" fileName="黄色.png" xy="5,0" size="252,256"/>
+    <text id="n2_mqh5" name="title" xy="0,98" size="256,52" fontSize="36" color="#ffffff" align="center" vAlign="middle" autoSize="none" strokeColor="#000000" strokeSize="0.1" text="10%">
+      <relation target="" sidePair="width-width,height-height"/>
+    </text>
+  </displayList>
+  <ProgressBar/>
+</component>

+ 14 - 0
FGUIProject/assets/HUD/ProgressBar4.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="256,256" extention="ProgressBar">
+  <displayList>
+    <image id="n3_mqh5" name="n3" src="hp1l93" fileName="阴影底板.png" xy="0,0"/>
+    <image id="n0_mqh5" name="n0" src="hp1l92" fileName="血条外框.png" xy="0,0" size="256,256">
+      <relation target="" sidePair="width-width,height-height"/>
+    </image>
+    <image id="n1_mqh5" name="bar" src="hp1l95" fileName="紫色.png" xy="4,0" size="252,256"/>
+    <text id="n2_mqh5" name="title" xy="0,98" size="256,53" fontSize="36" color="#ffffff" align="center" vAlign="middle" autoSize="none" strokeColor="#000000" strokeSize="0.1" text="10%">
+      <relation target="" sidePair="width-width,height-height"/>
+    </text>
+  </displayList>
+  <ProgressBar/>
+</component>

+ 6 - 0
FGUIProject/assets/HUD/package.xml

@@ -44,6 +44,12 @@
     <component id="hp1l9c" name="MaskIcon3.xml" path="/"/>
     <component id="hp1l9d" name="RanklistItem(1).xml" path="/"/>
     <component id="hp1l9e" name="RanklistItem(1)(1).xml" path="/"/>
+    <image id="mqh59f" name="第一名.png" path="/"/>
+    <image id="mqh59g" name="第二名.png" path="/"/>
+    <image id="mqh59h" name="第三名.png" path="/"/>
+    <component id="mqh59i" name="ProgressBar3.xml" path="/"/>
+    <component id="mqh59j" name="ProgressBar4.xml" path="/"/>
+    <component id="mqh59k" name="CompMsg.xml" path="/"/>
   </resources>
   <publish name=""/>
 </packageDescription>

BIN
FGUIProject/assets/HUD/第一名.png


BIN
FGUIProject/assets/HUD/第三名.png


BIN
FGUIProject/assets/HUD/第二名.png


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


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


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

@@ -10,7 +10,9 @@ using System;
 using System.IO;
 using System.Linq;
 using System.Text.RegularExpressions;
+using UnityEngine;
 using XmdsCommon.Message;
+using XmdsCommon.Plugin;
 
 namespace ET
 {
@@ -20,7 +22,7 @@ namespace ET
         public ZoneLayer Layer;
 
         private readonly MemoryStream writeBuffer = new MemoryStream(2048);
-        private EventDispatcher<Event> eventHandler;
+        private EventDispatcher<CommonAI.Zone.Event> eventHandler;
         private static CommonLang.Geometry.Vector3 vecTemp = new();
         private HashMap<int, BattleUnit> UnitTemplateIdHash = new();
 
@@ -36,13 +38,13 @@ namespace ET
             Layer.ObjectEnter += LayerEvent_ObjectEnter;
             Layer.ObjectLeave += LayerEvent_ObjectLeave;
             Layer.MessageReceived += (ZoneLayer _, CommonLang.Protocol.IMessage msg) => {
-                if (msg is SyncPosEvent || msg is UnitForceSyncPosEvent || msg is LaunchSkill || msg is AddSpellEvent || msg is RemoveObjectEvent || msg is AddUnitEvent || msg is PlayerFocuseTargetEvent || msg is UnitFieldChangedEvent || msg is UnitEffectEvent || msg is UnitLaunchSkillEvent || msg is PlayerSkillStopEvent || msg is UnitHitEvent || msg is UnitLaunchBuffEvent)
+                /*if (msg is SyncPosEvent || msg is UnitForceSyncPosEvent || msg is LaunchSkill || msg is AddSpellEvent || msg is RemoveObjectEvent || msg is AddUnitEvent || msg is PlayerFocuseTargetEvent || msg is UnitFieldChangedEvent || msg is UnitEffectEvent || msg is UnitLaunchSkillEvent || msg is PlayerSkillStopEvent || msg is UnitHitEvent || msg is UnitLaunchBuffEvent)
                 { }
                 else
                 {
                     Log.Debug($"<<<BattleEvent: {msg}");
-                }
-                eventHandler.Notify(msg as Event);
+                }*/
+                eventHandler.Notify(msg as CommonAI.Zone.Event);
             };
             Layer.DecorationChanged += (ZoneLayer _, ZoneEditorDecoration ed) => {
                 Log.Error("not implements: DecorationChanged");
@@ -55,6 +57,28 @@ namespace ET
             Layer.BeginUpdate(timeMS);
             Layer.Update();
             this.doUpdate();
+
+            KeyboardCheckUpdate();
+        }
+
+        private void KeyboardCheckUpdate()
+        {
+            if(Input.GetKeyDown(KeyCode.F1))
+            {
+                EventSystem.Instance.Publish(BattleFunc.Static.Clone(2));
+            }
+            else if(Input.GetKeyDown(KeyCode.F2))
+            {
+                EventSystem.Instance.Publish(BattleFunc.Static.Clone(4));
+            }
+            else if (Input.GetKeyDown(KeyCode.F3))
+            {
+                EventSystem.Instance.Publish(BattleFunc.Static.Clone(5));
+            }
+            else if (Input.GetKeyDown(KeyCode.F4))
+            {
+                EventSystem.Instance.Publish(BattleFunc.Static.Clone(3));
+            }
         }
 
         //ILayerClient接口实现,供layer层调用
@@ -101,6 +125,7 @@ namespace ET
             Log.Debug($"OnLayerInit- scene template ID:{layer.Data.ID}");
         }
 
+        bool bFirstEnemy = true;
         //单位进入战斗  
         protected void LayerEvent_ObjectEnter(ZoneLayer layer, ZoneObject obj)
         {
@@ -127,7 +152,15 @@ namespace ET
                         UnitTemplateIdHash.Add(tid, bu);
                     }
 
-                    Log.Debug($"OnObjectEnter: {bu.ZUnit.TemplateID}@{obj.ObjectID}");
+                    //Log.Debug($"OnObjectEnter: {bu.ZUnit.TemplateID}@{obj.ObjectID}");
+                    if(bFirstEnemy && bu.ZUnit.Info.Properties is XmdsUnitProperties prop)
+                    {
+                        if (prop.GameStatusType == XmdsUnitProperties.StatusType.SpecialBoss)
+                        {
+                            bFirstEnemy = false;
+                            EventSystem.Instance.Publish(BattleMsgEvent.Static.Clone("发现怪兽来袭,宝宝们一起来守护家园吧!"));
+                        }
+                    }
                 }
             }
         }
@@ -189,7 +222,7 @@ namespace ET
             eventHandler.AddListener<UnitDeadEvent>((ev) =>
             {
                 var e = ev as UnitDeadEvent;
-                Log.Debug($"Unit({e.object_id}) dead");
+                //Log.Debug($"Unit({e.object_id}) dead");
 
                 var unit = UnitMgr.Instance.GetUnit(e.ObjectID);
                 if(unit != null && unit is BattleUnit bunit)
@@ -218,6 +251,18 @@ namespace ET
                         vecTemp.Set(unit.ZoneObject.X, unit.ZoneObject.Y, unit.ZoneObject.Z);
                         EventSystem.Instance.Publish(PlayEffectEvent.Static.Clone(launcheffect, unit.Id, vecTemp));
                     }
+
+                    if (bunit.ZUnit.Info.Properties is XmdsUnitProperties prop)
+                    {
+                        if (prop.GameStatusType == XmdsUnitProperties.StatusType.SpecialBoss)
+                        {
+                            EventSystem.Instance.Publish(BattleMsgEvent.Static.Clone("花园宝宝因抵挡不住怪物致命一击,失去了所有能量"));
+                        }
+                        else
+                        {
+                            EventSystem.Instance.Publish(BattleMsgEvent.Static.Clone("怪兽‘蝙蝠侠’,在众宝宝的合力攻击下,倒地不起"));
+                        }
+                    }
                 }
             });
             eventHandler.AddListener<UnitRebirthEvent>((ev) =>
@@ -250,8 +295,8 @@ namespace ET
                         var sender = UnitMgr.Instance.GetUnit(e.senderId);
                         if (sender != null)
                         {
-                            Vector3 difpos = new Vector3(unit.ZoneObject.X, unit.ZoneObject.Y, 0) - new Vector3(sender.ZoneObject.X, sender.ZoneObject.Y, 0);
-                            roation = (float)-Math.Atan2(-difpos.Y, difpos.X);
+                            UnityEngine.Vector3 difpos = new UnityEngine.Vector3(unit.ZoneObject.X, unit.ZoneObject.Y, 0) - new UnityEngine.Vector3(sender.ZoneObject.X, sender.ZoneObject.Y, 0);
+                            roation = (float)-Math.Atan2(-difpos.y, difpos.x);
                         }
                     }
                     if (hitEffect.BindBody)
@@ -336,7 +381,7 @@ namespace ET
             SyncFlagsEvent
             ChangeBGMEvent
             PlayDestoryEffect*/
-            /*var e = msg as CommonAI.Zone.Event;
+            /*var e = msg as CommonAI.Zone.CommonAI.Zone.Event;
            if (e is ChatEvent)
            {
                var evt = (e as ChatEvent);
@@ -390,7 +435,7 @@ namespace ET
                            result = (dic["MsgContent"] as string);
                        }
                        //
-                       EventManager.Fire("Event.OnEventHandler.star", new Dictionary<string, string>() {
+                       EventManager.Fire("CommonAI.Zone.Event.OnEventHandler.star", new Dictionary<string, string>() {
                        {"content", result}, {"keepTime", "" + (evt.KeepTimeMS/1000)}, {"content_is_text", "true"}
                    });
                    }
@@ -448,7 +493,7 @@ namespace ET
                    else
                    {
                        //普通chatevent
-                       EventManager.Fire("Event.OnEventHandler.star", new Dictionary<string, string>() {
+                       EventManager.Fire("CommonAI.Zone.Event.OnEventHandler.star", new Dictionary<string, string>() {
                        {"content", msg}, {"isImportant", "1"}, {"keepTime", "" + (evt.KeepTimeMS/1000)}
                    });
                    }

+ 11 - 6
Unity/Assets/Scripts/Codes/Hotfix/Client/battle/BattleMgr_Cmd.cs

@@ -23,11 +23,12 @@ namespace ET
                     var rand = new Random();
                     foreach (var id in units)
                     {
-                        float r = (rand.Next(1000)) / 100.0f + 5;
-                        double ang = rand.Next(180) / 180.0f * Math.PI + Math.PI;
+                        float r = (rand.Next(1000)) / 30.0f + 8;
+                        double ang = rand.Next(120) / 180.0f * Math.PI + Math.PI;
                         Log.Debug($"rand unit r({r}), ang({ang})");
                         float x = centerpos.X + (float)(r * Math.Cos(ang));
                         float y = centerpos.Y - (float)(r * Math.Sin(ang));
+                        Log.Debug($"born unit: r:{r}, ang:{ang}---({x},{y})");
 
                         session.Call(new C2G_AddUnitsToMap()
                         {
@@ -37,6 +38,7 @@ namespace ET
                             Y = (int)y
                         }).Coroutine();
                     }
+                    EventSystem.Instance.Publish(BattleMsgEvent.Static.Clone("'宝宝一'进入了游戏,和大家一起守护家园!"));
                     break;
                 case 3:
                     session.Call(new C2G_TriggrBattleFunction()
@@ -49,6 +51,7 @@ namespace ET
                         Value5 = 0,
                         Value6 = 0,
                     }).Coroutine();
+                    EventSystem.Instance.Publish(BattleMsgEvent.Static.Clone("花园宝宝使用了道具‘电池’,释放出巨大能量"));
                     break;
                 case 4:
                     var units2 = new int[] { 102, 112, 122, 132 };
@@ -56,8 +59,8 @@ namespace ET
                     rand = new Random();
                     foreach (var id in units2)
                     {
-                        float r = (rand.Next(1000)) / 100.0f + 5;
-                        double ang = rand.Next(180) / 180.0f * Math.PI + Math.PI;
+                        float r = (rand.Next(1000)) / 30.0f + 8;
+                        double ang = rand.Next(120) / 180.0f * Math.PI + Math.PI;
                         Log.Debug($"rand unit r({r}), ang({ang})");
                         float x = centerpos.X + (float)(r * Math.Cos(ang));
                         float y = centerpos.Y - (float)(r * Math.Sin(ang));
@@ -70,6 +73,7 @@ namespace ET
                             Y = (int)y
                         }).Coroutine();
                     }
+                    EventSystem.Instance.Publish(BattleMsgEvent.Static.Clone("'宝宝一'使用了'甜甜圈道'成功变形为‘二级宝宝’"));
                     break;
                 case 5:
                     var units3 = new int[] { 103, 113, 123, 133 };
@@ -77,8 +81,8 @@ namespace ET
                     rand = new Random();
                     foreach (var id in units3)
                     {
-                        float r = (rand.Next(1000)) / 100.0f + 5;
-                        double ang = rand.Next(180) / 180.0f * Math.PI + Math.PI;
+                        float r = (rand.Next(1000)) / 30.0f + 8;
+                        double ang = rand.Next(120) / 180.0f * Math.PI + Math.PI;
                         Log.Debug($"rand unit r({r}), ang({ang})");
                         float x = centerpos.X + (float)(r * Math.Cos(ang));
                         float y = centerpos.Y - (float)(r * Math.Sin(ang));
@@ -91,6 +95,7 @@ namespace ET
                             Y = (int)y
                         }).Coroutine();
                     }
+                    EventSystem.Instance.Publish(BattleMsgEvent.Static.Clone("'宝宝二'使用了'魔棒'道具,成功变形为‘三级宝宝’"));
                     break;
             }
         }

+ 10 - 0
Unity/Assets/Scripts/Codes/Hotfix/Client/battle/unit/BattleUnit.cs

@@ -131,6 +131,8 @@ public class BattleUnit : BattleObject
         }
     }
 
+    bool bFirstShow1 = true;
+    bool bFirstShow2 = true;
     private void OnHPChanged()
     {
         if (ZUnit.Info.Properties is XmdsUnitProperties prop)
@@ -141,6 +143,14 @@ public class BattleUnit : BattleObject
                 var pg = (float)ZUnit.HP * 100 / ZUnit.MaxHP;
                 EventSystem.Instance.Publish<HPRefresh>(HPRefresh.Static.Clone(HPRefresh.Index.Tower, pg, hp));
                 //Log.Debug($"tower({ZUnit.ObjectID}@{ZUnit.Info.Name}) hp: {ZUnit.HP}/{ZUnit.MaxHP}");
+                if(bFirstShow1 && pg < 50)
+                {
+                    EventSystem.Instance.Publish(BattleMsgEvent.Static.Clone("家园宝塔受到了怪物的猛烈攻击"));
+                }
+                else if(bFirstShow1 && pg < 10)
+                {
+                    EventSystem.Instance.Publish(BattleMsgEvent.Static.Clone("家园宝塔快要支撑不住了,宝宝们快来守护"));
+                }
             }
             else if (prop.GameStatusType == XmdsUnitProperties.StatusType.SpecialBoss)
             {

+ 57 - 15
Unity/Assets/Scripts/Codes/HotfixView/Client/UI/HUD/SceneChangeFinishEvent_CreateHUD.cs

@@ -12,7 +12,6 @@ namespace ET.Client
         }
         private async ETTask asyncTask()
         {
-            Log.Debug("loading HUD");
             var view = await UIHelper.Create("HUD");
             HUDMgr.InitView(view);
         }
@@ -35,18 +34,39 @@ namespace ET.Client
     [Event(SceneType.None)]
     public class HPRefreshEventHandler : BEvent<HPRefresh>
     {
+        GProgressBar progressBar1;
+        GProgressBar progressBar2;
+        GTextField txt1;
+        GTextField txt2;
+
         public override void OnEvent(HPRefresh a)
         {
-            var view = UIHelper.GetUI("HUD") as GComponent;
-            if(view == null)
+            GProgressBar progress = null;
+            GTextField txt = null;
+            if(a.HPIndex == HPRefresh.Index.Tower)
             {
-                return;
+                if(progressBar1 == null)
+                {
+                    var view = UIHelper.GetUI("HUD") as GComponent;
+                    progressBar1 = view.GetChild("HPBar1").asProgress;
+                    txt1 = progressBar1.GetChild("title").asTextField;
+                }
+                progress = progressBar1;
+                txt = txt1;
+            }
+            else
+            {
+                if (progressBar2 == null)
+                {
+                    var view = UIHelper.GetUI("HUD") as GComponent;
+                    progressBar2 = view.GetChild("HPBar2").asProgress;
+                    txt2 = progressBar2.GetChild("title").asTextField;
+                }
+                progress = progressBar2;
+                txt = txt2;
             }
 
-            int index = (int)a.HPIndex;
-            var progress = view.GetChild($"progressbar_{index}") as GProgressBar;
             progress.visible = true;
-            var txt = view.GetChild($"txt_hp{index}");
             progress.value = a.Progress;
             txt.text = a.Progress.ToString("F2") + "%";
         }
@@ -91,14 +111,36 @@ namespace ET.Client
         }
     }
 
+    [Event(SceneType.None)]
+    public class BattleMsgHandler : BEvent<BattleMsgEvent>
+    {
+        int CurIndex = 0;
+        public override void OnEvent(BattleMsgEvent a)
+        {
+            var view = UIHelper.GetUI("HUD") as GComponent;
+            var list = view.GetChild("InfoList").asList;
+
+            if(CurIndex >= list.numChildren)
+            {
+                CurIndex = 0;
+            }
+
+            var comp = list.GetChildAt(CurIndex).asCom;
+            var txt = comp.GetChild("text");
+            txt.text = a.msg;
+
+            ++CurIndex;
+        }
+    }
+
     public static class HUDMgr
     {
         public static void InitView(GComponent view)
         {
-            var btn1 = view.GetChild("btn_skill1");
+            /*var btn1 = view.GetChild("btn_skill1");
             var btn2 = view.GetChild("btn_skill2");
 
-            /*var actor = UnitMgr.Instance.Actor;
+            var actor = UnitMgr.Instance.Actor;
             if (actor == null || !actor.IsSkillOk)
             {
                 btn1.visible = false;
@@ -115,10 +157,10 @@ namespace ET.Client
 
             btn2.onClick.Set(() => {
                 EventSystem.Instance.Publish<LaunchSkillEvent>(LaunchSkillEvent.Static.Clone(1));
-            });*/
+            });
 
             btn1.visible = false;
-            btn2.visible = false;
+            btn2.visible = false;*/
             for (int i=1; i<= 99; i++)
             {
                 var btn = view.GetChild($"btn_func{i}");
@@ -148,12 +190,12 @@ namespace ET.Client
                 GameSetting.Instance.SetBool(GameSetting.Sets.Mute_int, isMute);
             });
 
-            var progress1 = view.GetChild("progressbar_1") as GProgressBar;
-            var progress2 = view.GetChild("progressbar_2") as GProgressBar;
+            var progress1 = view.GetChild("HPBar1") as GProgressBar;
+            var progress2 = view.GetChild("HPBar2") as GProgressBar;
             progress1.visible = progress2.visible = false;
-            var txthp1 = view.GetChild("txt_hp1");
+            var txthp1 = progress1.GetChild("title");
             txthp1.text = "";
-            var txthp2 = view.GetChild("txt_hp2");
+            var txthp2 = progress2.GetChild("title");
             txthp2.text = "";
         }
     }

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

@@ -194,6 +194,17 @@ namespace ET
                 return this;
             }
         }
+
+        public class BattleMsgEvent
+        {
+            public string msg;
+            public static BattleMsgEvent Static = new();
+            public BattleMsgEvent Clone(string m)
+            {
+                msg = m;
+                return this;
+            }
+        }
     }
 
     //状态指令