// 能找到所有的root go节点
GameObject[] allGos = UnityEngine.SceneManagement.SceneManager.GetActiveScene().GetRootGameObjects();
// 找不到隐藏的go
GameObject[] allGos = (GameObject[])UnityEngine.Object.FindObjectsOfType(typeof(GameObject));
// 连隐藏的go都能找到
GameObject[] pAllObjects = (GameObject[])Resources.FindObjectsOfTypeAll(typeof(GameObject));