fix: PlayOpeningFlow/ReturnToHome重置所有ping/chanrao为隐藏

- OpeningFlowController新增DeactivateManInjuryChildren遍历隐藏
- PageController.ReturnToHome同样遍历隐藏ping/chanrao
- 解决上一轮实验残留导致ping自动出现的bug
This commit is contained in:
yangbear
2026-07-04 16:48:30 +08:00
parent dee680a458
commit 77f6e2f00d
3 changed files with 75 additions and 6 deletions
+54 -6
View File
@@ -252,13 +252,13 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2741973}
serializedVersion: 2
m_LocalRotation: {x: 0.08211052, y: 0.6831766, z: -0.06511615, w: 0.7226947}
m_LocalPosition: {x: -10.137, y: 0.729, z: -8.572}
m_LocalRotation: {x: 0.22525975, y: 0.65627223, z: -0.20069145, w: 0.6915835}
m_LocalPosition: {x: -9.759, y: 1.293, z: -8.896}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 11.985, y: 86.891, z: 1.059}
m_LocalEulerAnglesHint: {x: 35.099, y: 87.399, z: 1.266}
--- !u!1 &4733890
GameObject:
m_ObjectHideFlags: 0
@@ -1428,7 +1428,7 @@ MonoBehaviour:
targetPosition: {fileID: 773787683}
womanObject: {fileID: 1096492308}
nextTouchObject: {fileID: 559340216}
voiceClip: {fileID: 8300000, guid: 6934b8b2c79df41118a058e984de2a7b, type: 3}
voiceClip: {fileID: 8300000, guid: 0f561ebe499594da29e31277de2f8a1f, type: 3}
--- !u!1 &37271315
GameObject:
m_ObjectHideFlags: 0
@@ -1906,7 +1906,7 @@ Transform:
m_GameObject: {fileID: 119178385}
serializedVersion: 2
m_LocalRotation: {x: 0.07359425, y: 0.5702997, z: -0.05157618, w: 0.8165061}
m_LocalPosition: {x: -10.766875, y: 1.1056681, z: -9.490227}
m_LocalPosition: {x: -11.772, y: 1.301, z: -9.859}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -3815,7 +3815,7 @@ MonoBehaviour:
targetPosition: {fileID: 958160146}
womanObject: {fileID: 1096492308}
nextTouchObject: {fileID: 198874067}
voiceClip: {fileID: 8300000, guid: 0f561ebe499594da29e31277de2f8a1f, type: 3}
voiceClip: {fileID: 8300000, guid: 845a704b4410b4393ab9327bfaf9d3ec, type: 3}
--- !u!1 &574962406
GameObject:
m_ObjectHideFlags: 0
@@ -8825,6 +8825,14 @@ PrefabInstance:
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: -7321129553036964808, guid: 36a64753ffd054a0e98c1efc8590f2a0,
type: 3}
insertIndex: -1
addedObject: {fileID: 1880212786}
- targetCorrespondingSourceObject: {fileID: -7321129553036964808, guid: 36a64753ffd054a0e98c1efc8590f2a0,
type: 3}
insertIndex: -1
addedObject: {fileID: 1880212785}
- targetCorrespondingSourceObject: {fileID: 1274676490386009228, guid: 36a64753ffd054a0e98c1efc8590f2a0,
type: 3}
insertIndex: -1
@@ -11244,6 +11252,46 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1870948488}
m_CullTransparentMesh: 1
--- !u!1 &1880212782 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: -7321129553036964808, guid: 36a64753ffd054a0e98c1efc8590f2a0,
type: 3}
m_PrefabInstance: {fileID: 1381048278}
m_PrefabAsset: {fileID: 0}
--- !u!65 &1880212785
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1880212782}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 0.4288026, y: 0.6431548, z: 0.3270818}
m_Center: {x: 0.0005388475, y: 0.41961163, z: -0.030557342}
--- !u!114 &1880212786
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1880212782}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2cf6b55fd9d5146c8a2ba5d06dc8466d, type: 3}
m_Name:
m_EditorClassIdentifier:
nextObject: {fileID: 2088997100}
--- !u!1 &1888357254
GameObject:
m_ObjectHideFlags: 0
@@ -31,6 +31,8 @@ public class OpeningFlowController : MonoBehaviour
if (_womanObject != null) _womanObject.SetActive(false);
if (_manInjuryObject != null) _manInjuryObject.SetActive(false);
// 确保所有 ping/chanrao/chanraotuibu 子级隐藏
DeactivateManInjuryChildren();
if (_blackScreenPanel != null)
{
@@ -198,4 +200,15 @@ public class OpeningFlowController : MonoBehaviour
[Header("=== 音效 ===")]
[SerializeField] private AudioClip _basketballClip;
[SerializeField] private AudioClip _manCallClip;
private void DeactivateManInjuryChildren()
{
if (_manInjuryObject == null) return;
foreach (Transform child in _manInjuryObject.transform)
{
if (child.name.Contains("ping") || child.name.Contains("chanrao"))
child.gameObject.SetActive(false);
}
Debug.Log("[OpeningFlow] manInjury ping/chanrao 已全部隐藏");
}
}
+8
View File
@@ -320,6 +320,14 @@ public class PageController : MonoBehaviour
if (manInjury != null) manInjury.SetActive(false);
var medicalBox = GameObject.Find("medicalBox");
if (medicalBox != null) medicalBox.SetActive(false);
// 隐藏所有 ping/chanrao/chanraotuibu
var mi = GameObject.Find("manInjury");
if (mi != null) {
foreach (Transform child in mi.transform) {
if (child.name.Contains("ping") || child.name.Contains("chanrao"))
child.gameObject.SetActive(false);
}
}
// 用名字找主摄像机(Camera.main 在禁用后返回 null
var mainGo = GameObject.Find("Main Camera");