Unity-获取同一个脚本下的不同对象
作者:互联网
1,同一个脚本挂载在不同的对象上
1 public class Lesson1 : MonoBehaviour 2 { 3 // Start is called before the first frame update 4 5 6 //public GameObject Obj1; 7 public Lesson1 ls1; 8 9 void Start() 10 { 11 12 print(ls1.gameObject.name); 13 14 } 15 16 // Update is called once per frame 17 void Update() 18 { 19 20 } 21 }
标签:脚本,Lesson1,同一个,frame,Update,Start,Unity,void,public 来源: https://www.cnblogs.com/yueqingli/p/15058689.html