Pārlūkot izejas kodu

修改BUFF消息分发逻辑,减少无意义的消息分发,提升性能

大爷 1 gadu atpakaļ
vecāks
revīzija
e34e884827

+ 4 - 1
Unity/Assets/Scripts/Codes/HotfixView/Client/Unit/OnNewZoneObject.cs

@@ -54,7 +54,10 @@ namespace ET.Client
             }
             //Log.Debug($"unitRender({zu.ObjectID}),pos({zu.X},{zu.Y},{zu.Z}) ok.");
 
-            EventSystem.Instance.Publish(BuffChangeEvent.Static.Clone(zu.ObjectID, null, BuffChangeType.Reload));
+            if(zu.GetBuffStatusCount() > 0)
+            {
+                EventSystem.Instance.Publish(BuffChangeEvent.Static.Clone(zu.ObjectID, null, BuffChangeType.Reload));
+            }
             //TODO: 同步ZoneUnit status
         }
 

+ 1 - 1
Unity/Assets/Scripts/Codes/HotfixView/Client/Unit/UnitRenderSystem.cs

@@ -88,7 +88,7 @@ namespace ET.Client
             }
             else
             {
-                Log.Debug($"Not exist unitRender: {args.Id}");
+                //Log.Debug($"Not exist unitRender: {args.Id}");
             }
             //_actor.SendUnitMove(dx, dy, true);
             //(_actor.ZUnit as ZoneActor).SendUnitStopMove();