From 4f144bef9a53a82ec1d3853545c53fd70357c810 Mon Sep 17 00:00:00 2001 From: m0_75251201 Date: Sat, 1 Nov 2025 15:53:39 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B7=BB=E5=8A=A0=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HideCharacter/HideCharacterComponent.cs | 11 +++++++++-- HideCharacter/obj/Debug/HideCharacter.AssemblyInfo.cs | 9 ++++----- .../obj/Debug/HideCharacter.AssemblyInfoInputs.cache | 2 +- SceneSnapshot/obj/Debug/SceneSnapshot.AssemblyInfo.cs | 9 ++++----- .../obj/Debug/SceneSnapshot.AssemblyInfoInputs.cache | 2 +- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/HideCharacter/HideCharacterComponent.cs b/HideCharacter/HideCharacterComponent.cs index 8c1661d..08380bc 100644 --- a/HideCharacter/HideCharacterComponent.cs +++ b/HideCharacter/HideCharacterComponent.cs @@ -83,16 +83,22 @@ namespace HideCharacter rendererList.Clear(); var obj = GameObject.Find("ModelRoot"); if (!obj) return; + //角色的模型是最先加载的,就直接先查找了,避免找到其他实体的身体 bodyPartObject = GameObject.Find("Pelvis"); - healthBar=GameObject.Find("HealthBars"); + healthBar = GameObject.Find("HealthBars"); needRefresh = true; - //防止无法正常恢复身体 + //身体的SkinnedMeshRenderer如果不隐藏会发现身体无法恢复 foreach (var skinnedMeshRenderer in obj.GetComponentsInChildren()) { rendererList.Add(skinnedMeshRenderer); } } + /// + /// 查找身体部件,不使用对Meshderer的隐藏是因为测试的时候发现没有正确隐藏, + /// 可能是测试逻辑错了,就先这样写了 + /// + /// void FindChildObjectsRecursively(Transform parentTransform) { foreach (Transform child in parentTransform) @@ -157,6 +163,7 @@ namespace HideCharacter { if (hideList != null) { + //使用懒刷新是因为发现在开始查找的时候会找不到眼睛和眉毛,可能是还没有创建,就改为在切换时刷新了 if (needRefresh) { if (bodyPartObject != null) diff --git a/HideCharacter/obj/Debug/HideCharacter.AssemblyInfo.cs b/HideCharacter/obj/Debug/HideCharacter.AssemblyInfo.cs index c0bd8b9..0270366 100644 --- a/HideCharacter/obj/Debug/HideCharacter.AssemblyInfo.cs +++ b/HideCharacter/obj/Debug/HideCharacter.AssemblyInfo.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 +// This code was generated by a tool. // -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -14,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("折纸的小箱子")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+997656613e0fbe2d5c91ade63b444626bd3b2118")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+67c886a904a55669c91d6b4d101ba669f1a59c5d")] [assembly: System.Reflection.AssemblyProductAttribute("HideCharacter")] [assembly: System.Reflection.AssemblyTitleAttribute("HideCharacter")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0")] diff --git a/HideCharacter/obj/Debug/HideCharacter.AssemblyInfoInputs.cache b/HideCharacter/obj/Debug/HideCharacter.AssemblyInfoInputs.cache index 43aadad..977471b 100644 --- a/HideCharacter/obj/Debug/HideCharacter.AssemblyInfoInputs.cache +++ b/HideCharacter/obj/Debug/HideCharacter.AssemblyInfoInputs.cache @@ -1 +1 @@ -48d289dd6735a7b3ddf70fbe6ce44ffed0c2efc083980141390d8c5617b15586 +423a7b55d07af8fb848effe82fa4e72899cf064d03a0fb4c9600918ccf2d9009 diff --git a/SceneSnapshot/obj/Debug/SceneSnapshot.AssemblyInfo.cs b/SceneSnapshot/obj/Debug/SceneSnapshot.AssemblyInfo.cs index 831786f..258e744 100644 --- a/SceneSnapshot/obj/Debug/SceneSnapshot.AssemblyInfo.cs +++ b/SceneSnapshot/obj/Debug/SceneSnapshot.AssemblyInfo.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 +// This code was generated by a tool. // -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -14,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("折纸的小箱子")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+997656613e0fbe2d5c91ade63b444626bd3b2118")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+67c886a904a55669c91d6b4d101ba669f1a59c5d")] [assembly: System.Reflection.AssemblyProductAttribute("SceneSnapshot")] [assembly: System.Reflection.AssemblyTitleAttribute("SceneSnapshot")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0")] diff --git a/SceneSnapshot/obj/Debug/SceneSnapshot.AssemblyInfoInputs.cache b/SceneSnapshot/obj/Debug/SceneSnapshot.AssemblyInfoInputs.cache index 301a59f..6a6e74e 100644 --- a/SceneSnapshot/obj/Debug/SceneSnapshot.AssemblyInfoInputs.cache +++ b/SceneSnapshot/obj/Debug/SceneSnapshot.AssemblyInfoInputs.cache @@ -1 +1 @@ -83eb8e0c4ef430532b21f1a1b7877dbc2a23fdbfef7150469e7b60e157f7be59 +c40649a2db1e99856594eda4b1fa3d71f4abfa511ffb3c2e60408c3d3561c7e2