1、
3、
public GameObject cameraMain;
or
public Camera MainCamera;
2、
transform.Find(" GameObject(01)/FameObject ");
//获取GameObject(01)下的GameObject
GameObject.Find(" Main Camera ");
3、
GameObject camera = GameObject.Find(" Main Camera ");
4
GameObject player = GameObject.FindWithTag(" Player "); //根据标签进行查找