diff --git a/Assets/Scripts/Fishing2.meta b/Assets/Scripts/Fishing2.meta index 7a0b13523..079701c61 100644 --- a/Assets/Scripts/Fishing2.meta +++ b/Assets/Scripts/Fishing2.meta @@ -1,3 +1,8 @@ fileFormatVersion: 2 guid: 370fe07e6dd1446298721033a240b4fd -timeCreated: 1756363974 \ No newline at end of file +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Fishing2/Message/Event/NumericChangeEvent.cs b/Assets/Scripts/Fishing2/Message/Event/NumericChangeEvent.cs index 97daaa896..08c5af9bf 100644 --- a/Assets/Scripts/Fishing2/Message/Event/NumericChangeEvent.cs +++ b/Assets/Scripts/Fishing2/Message/Event/NumericChangeEvent.cs @@ -9,6 +9,7 @@ namespace NBF.Fishing2 { protected override void Handler(NumericChange self) { + if (self.Old == self.New) return; if (self.NumericType == NumericType.Flashlight) { var flashlight = self.MapUnit.GetComponent(); diff --git a/Assets/Scripts/Fishing2/Message/Map2C_RolePropertyChangeNotifyHandler.cs b/Assets/Scripts/Fishing2/Message/Map2C_RolePropertyChangeNotifyHandler.cs index 610e6e3c3..f27be2f69 100644 --- a/Assets/Scripts/Fishing2/Message/Map2C_RolePropertyChangeNotifyHandler.cs +++ b/Assets/Scripts/Fishing2/Message/Map2C_RolePropertyChangeNotifyHandler.cs @@ -8,6 +8,7 @@ namespace NBF.Fishing2 { protected override async FTask Run(Session session, Map2C_RolePropertyChangeNotify message) { + Log.Info($"收到角色属性推送 id={message.Id}"); var map = App.Main.GetComponent(); var unit = map.Units[message.Id]; var numericComponent = unit.GetComponent(); diff --git a/Assets/Scripts/Fishing2/Unit/Unity/UnitUnityComponent.cs b/Assets/Scripts/Fishing2/Unit/Unity/UnitUnityComponent.cs index 37aa72c82..9ed80f509 100644 --- a/Assets/Scripts/Fishing2/Unit/Unity/UnitUnityComponent.cs +++ b/Assets/Scripts/Fishing2/Unit/Unity/UnitUnityComponent.cs @@ -23,7 +23,8 @@ namespace NBF.Fishing2 GameObject = gameObject; Transform = gameObject.transform; Asset = gameObject.GetComponent(); - Parent.AddComponent(); + Parent.GetOrAddComponent(); + Parent.GetOrAddComponent(); }