gameObject.active和gameObject.activeInHierarchy都可以显示在父物体不激活的状态 返回 不激活。
gameObject.activeSelf仅显示自身物体是否激活,不管父物体是否激活
只有名字带False的物体 为 非激活状态
using UnityEngine;
using UnityEngine.UI;
public class TestActive : MonoBehaviour
{
public GameObject gameObject1;
public GameObject gameObject2;
public GameObject gameObject3;
public GameObject gameObject4;
public Text text;
public string str = "";
// Start is called before the first frame update
void Start()
{
getActive(gameObject1);
getActive(ga