From fde0f0c6d49fc460ec88e5a5890874fadc31a305 Mon Sep 17 00:00:00 2001 From: "DESKTOP-3LEE30U\\star" Date: Thu, 11 Aug 2022 18:06:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8D=87=E7=BA=A7=E5=BB=BA?= =?UTF-8?q?=E7=AD=91=E7=9A=84=E4=B8=80=E4=BA=9B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Demo/Building/Handler/M2C_BuildingDurableHandler.cs | 6 ++++++ Unity/Animancer.FSM.csproj | 9 --------- Unity/Animancer.csproj | 9 --------- Unity/Assets/Scenes/Game.unity | 9 +++++++-- Unity/Codes/Hotfix/Demo/Helper/BuildingHelper.cs | 6 ++++++ Unity/Codes/Hotfix/Demo/Operate/ConstructOperate.cs | 4 ++++ .../Demo/Building/BuildingViewComponentSystem.cs | 4 ++++ .../Building/CameraPosChange_UpdateBuildingNamePos.cs | 2 +- .../Building/FUIBuildingUpgradeWindowComponentSystem.cs | 6 ++++-- Unity/Codes/Model/Module/Message/OpcodeHelper.cs | 4 +++- 10 files changed, 35 insertions(+), 24 deletions(-) diff --git a/Server/Hotfix/Demo/Building/Handler/M2C_BuildingDurableHandler.cs b/Server/Hotfix/Demo/Building/Handler/M2C_BuildingDurableHandler.cs index d357299..3d39746 100644 --- a/Server/Hotfix/Demo/Building/Handler/M2C_BuildingDurableHandler.cs +++ b/Server/Hotfix/Demo/Building/Handler/M2C_BuildingDurableHandler.cs @@ -10,6 +10,12 @@ namespace ET try { var bc = unit.GetComponent(); + if (bc == null || bc.Children == null) + { + reply(); + return; + } + if (request.BuildingId > 0) { Building building = bc.GetChild(request.BuildingId); diff --git a/Unity/Animancer.FSM.csproj b/Unity/Animancer.FSM.csproj index 8c724c1..4432b1b 100644 --- a/Unity/Animancer.FSM.csproj +++ b/Unity/Animancer.FSM.csproj @@ -310,9 +310,6 @@ C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\Managed\UnityEditor.Graphs.dll - - C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\PlaybackEngines\AndroidPlayer\UnityEditor.Android.Extensions.dll - C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\PlaybackEngines\WindowsStandaloneSupport\UnityEditor.WindowsStandalone.Extensions.dll @@ -349,12 +346,6 @@ Assets\ThirdParty\NCalc\NCalc.dll - - C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\PlaybackEngines\AndroidPlayer\Unity.Android.Types.dll - - - C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\PlaybackEngines\AndroidPlayer\Unity.Android.Gradle.dll - C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\mscorlib.dll diff --git a/Unity/Animancer.csproj b/Unity/Animancer.csproj index 779372b..7017be2 100644 --- a/Unity/Animancer.csproj +++ b/Unity/Animancer.csproj @@ -447,9 +447,6 @@ C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\Managed\UnityEditor.Graphs.dll - - C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\PlaybackEngines\AndroidPlayer\UnityEditor.Android.Extensions.dll - C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\PlaybackEngines\WindowsStandaloneSupport\UnityEditor.WindowsStandalone.Extensions.dll @@ -486,12 +483,6 @@ Assets\ThirdParty\NCalc\NCalc.dll - - C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\PlaybackEngines\AndroidPlayer\Unity.Android.Types.dll - - - C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\PlaybackEngines\AndroidPlayer\Unity.Android.Gradle.dll - C:\Program Files\Unity\Hub\Editor\2021.3.7f1c1\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\mscorlib.dll diff --git a/Unity/Assets/Scenes/Game.unity b/Unity/Assets/Scenes/Game.unity index 1eb2691..0f17e32 100644 --- a/Unity/Assets/Scenes/Game.unity +++ b/Unity/Assets/Scenes/Game.unity @@ -546,7 +546,7 @@ NavMeshAgent: m_GameObject: {fileID: 804818787} m_Enabled: 1 m_AgentTypeID: 0 - m_Radius: 0.5 + m_Radius: 0.1 m_Speed: 5 m_Acceleration: 100 avoidancePriority: 50 @@ -1518,7 +1518,7 @@ MonoBehaviour: m_OverrideTileSize: 0 m_TileSize: 256 m_OverrideVoxelSize: 0 - m_VoxelSize: 0.033333335 + m_VoxelSize: 0.16666667 m_BuildHeightMesh: 0 m_HideEditorLogs: 0 m_NavMeshData: {fileID: 23800000, guid: d5619753999409f4b86af078c3f3050a, type: 2} @@ -1589,6 +1589,11 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 1504570233403092943, guid: 1bfa233c465a65d4591c50583242e7f2, + type: 3} + propertyPath: m_Radius + value: 0.1 + objectReference: {fileID: 0} - target: {fileID: 3678915325285043676, guid: 1bfa233c465a65d4591c50583242e7f2, type: 3} propertyPath: m_LocalRotation.w diff --git a/Unity/Codes/Hotfix/Demo/Helper/BuildingHelper.cs b/Unity/Codes/Hotfix/Demo/Helper/BuildingHelper.cs index e35ec30..79a0f43 100644 --- a/Unity/Codes/Hotfix/Demo/Helper/BuildingHelper.cs +++ b/Unity/Codes/Hotfix/Demo/Helper/BuildingHelper.cs @@ -72,6 +72,12 @@ namespace ET return resp.Error; } var bc = unit.GetComponent(); + + if (bc == null) + { + return ErrorCode.ERR_Success; + } + for (int i=0; i< resp.IdList.Count;i++) { var building = bc.GetChild(resp.IdList[i]); diff --git a/Unity/Codes/Hotfix/Demo/Operate/ConstructOperate.cs b/Unity/Codes/Hotfix/Demo/Operate/ConstructOperate.cs index bf079ee..f5aa5d3 100644 --- a/Unity/Codes/Hotfix/Demo/Operate/ConstructOperate.cs +++ b/Unity/Codes/Hotfix/Demo/Operate/ConstructOperate.cs @@ -150,6 +150,10 @@ namespace ET if (construct.IsUpgrade) { build = unit.GetOrAddComponent().GetChild(construct.BuildingId); + if (build == null) + { + Log.Error($"Can't find building:{construct.BuildingId} for construct:{construct.Id}"); + } } else { diff --git a/Unity/Codes/HotfixView/Demo/Building/BuildingViewComponentSystem.cs b/Unity/Codes/HotfixView/Demo/Building/BuildingViewComponentSystem.cs index e928775..6ec2907 100644 --- a/Unity/Codes/HotfixView/Demo/Building/BuildingViewComponentSystem.cs +++ b/Unity/Codes/HotfixView/Demo/Building/BuildingViewComponentSystem.cs @@ -152,6 +152,10 @@ namespace ET return; } + FUIUnitNamePanelComponent unitNamePanelComponent = FUIComponent.Instance.GetUI(FUI_UnitNamePanel.UIResName) as FUIUnitNamePanelComponent; + unitNamePanelComponent.FUIUnitNamePanel.FGComp.RemoveChild(self.UnitName.FGComp); + self.UnitName.Dispose(); + var sprRender = self.BuildingRoot.GetComponentInChildren(); mapComp.MarkPlaceOnGrid(self.BuildingRoot.transform.position, mapComp.GetSizeBySpriteCollider(sprRender), false); self.BuildingRoot.SetActive(false); diff --git a/Unity/Codes/HotfixView/Demo/Building/CameraPosChange_UpdateBuildingNamePos.cs b/Unity/Codes/HotfixView/Demo/Building/CameraPosChange_UpdateBuildingNamePos.cs index 73899be..2fa916e 100644 --- a/Unity/Codes/HotfixView/Demo/Building/CameraPosChange_UpdateBuildingNamePos.cs +++ b/Unity/Codes/HotfixView/Demo/Building/CameraPosChange_UpdateBuildingNamePos.cs @@ -13,7 +13,7 @@ namespace ET foreach (var v in buildingComp.Children) { var buildingViewComp = v.Value.GetComponent(); - buildingViewComp.UpdateNamePos(); + buildingViewComp?.UpdateNamePos(); } } } diff --git a/Unity/Codes/HotfixView/Demo/FUI/Logic/Building/FUIBuildingUpgradeWindowComponentSystem.cs b/Unity/Codes/HotfixView/Demo/FUI/Logic/Building/FUIBuildingUpgradeWindowComponentSystem.cs index e0c50ec..395abf3 100644 --- a/Unity/Codes/HotfixView/Demo/FUI/Logic/Building/FUIBuildingUpgradeWindowComponentSystem.cs +++ b/Unity/Codes/HotfixView/Demo/FUI/Logic/Building/FUIBuildingUpgradeWindowComponentSystem.cs @@ -146,12 +146,14 @@ namespace ET return; } Unit unit = UnitHelper.GetMyUnitFromZoneScene(self.ZoneScene()); - Log.Error($"CurUpgradeSynthesisConfigId:{self.CurUpgradeSynthesisConfigId}"); int result = await ConstructHelper.CreateConstruct(unit, self.CurUpgradeSynthesisConfigId, self.Building.Position.x, self.Building.Position.y, self.Building.Id); - if (result != ErrorCode.ERR_Success) + if (result == ErrorCode.ERR_Success) { + // 删除原来建筑的表现,等待新房子建成换成新的 + self.Building.RemoveComponent(); + self.Window.Hide(); } } diff --git a/Unity/Codes/Model/Module/Message/OpcodeHelper.cs b/Unity/Codes/Model/Module/Message/OpcodeHelper.cs index a83e929..88447f4 100644 --- a/Unity/Codes/Model/Module/Message/OpcodeHelper.cs +++ b/Unity/Codes/Model/Module/Message/OpcodeHelper.cs @@ -9,7 +9,9 @@ namespace ET OuterOpcode.C2G_Ping, OuterOpcode.G2C_Ping, OuterOpcode.M2C_GameTime, - OuterOpcode.C2M_GameTime + OuterOpcode.C2M_GameTime, + OuterOpcode.C2M_PeopleMove, + OuterOpcode.M2C_PeopleMove }; private static bool IsNeedLogMessage(ushort opcode)