/// <summary>
/// // *** 设置本节点及所有父节点的可见
/// </summary>
public static void SetUpActive(this GameObject _go)
{
SetUpActive(_go.transform);
}
/// <summary>
/// // *** 设置本节点及所有父节点的可见
/// </summary>
public static void SetUpActive(this Transform _tra)
{
Transform tempTra = _tra;
do
{
if (!tempTra.gameObject.activeSelf)
{
tempTra.gameObject.SetActive(true);
}
tempTra = tempTra.parent;
}
while (tempTra != null);
}
Unity 设置所有父节点可见
最新推荐文章于 2023-09-16 20:47:47 发布