This commit is contained in:
李浩 2025-05-09 14:15:29 +08:00
commit f933c8d1c4
2 changed files with 19 additions and 5 deletions

View File

@ -9990,7 +9990,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 296163866} m_GameObject: {fileID: 296163866}
m_Enabled: 0 m_Enabled: 1
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1f127f2bf137e12439e2b140488ef479, type: 3} m_Script: {fileID: 11500000, guid: 1f127f2bf137e12439e2b140488ef479, type: 3}
m_Name: m_Name:

View File

@ -40,8 +40,15 @@ namespace QFramework.Example
{ {
string name = bodys[index]; string name = bodys[index];
var body = root.subBody[name]; var body = root.subBody[name];
Utility.FindObj(body.Path)?.SetActive(true); var obj = Utility.FindObj(body.Path);
index++; if (obj!=null)
{
foreach (var item in obj.GetComponentsInChildren<Transform>(true))
{
item.gameObject.SetActive(true);
}
index++;
}
} }
} }
@ -49,10 +56,17 @@ namespace QFramework.Example
{ {
if (index > 0) if (index > 0)
{ {
index--;
string name = bodys[index]; string name = bodys[index];
var body = root.subBody[name]; var body = root.subBody[name];
Utility.FindObj(body.Path)?.SetActive(false); var obj = Utility.FindObj(body.Path);
if (obj!=null)
{
foreach (var item in obj.GetComponentsInChildren<Transform>(true))
{
item.gameObject.SetActive(false);
}
index--;
}
} }
} }
} }