42 lines
823 B
C#
Raw Normal View History

2025-04-17 09:38:18 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SetFalse : MonoBehaviour
{
public Transform[] hiddenChildren;
[ContextMenu("<22><><EFBFBD><EFBFBD>")]
// Start is called before the first frame update
void Setttt()
{
2025-05-07 13:58:48 +08:00
HideChildrenRecursively(transform, false);
}
[ContextMenu("<22><>ʾ")]
// Start is called before the first frame update
void SetTrue()
{
HideChildrenRecursively(transform,true);
2025-04-17 09:38:18 +08:00
}
void Start()
{
}
2025-05-07 13:58:48 +08:00
void HideChildrenRecursively(Transform parent,bool ist)
2025-04-17 09:38:18 +08:00
{
foreach (Transform child in parent)
{
// <20><><EFBFBD>ص<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2025-05-07 13:58:48 +08:00
child.gameObject.SetActive(ist);
2025-04-17 09:38:18 +08:00
// <20>ݹ<EFBFBD><DDB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2025-05-07 13:58:48 +08:00
HideChildrenRecursively(child, ist);
2025-04-17 09:38:18 +08:00
}
}
}