调用其他脚本中的变量

a08d2348ce2e4947ae60a753e6176d7c.png

 8c0e15a1969645c791c000647c8dc0cc.png

 在要调用其他脚本变量的脚本中声明,public  另一个脚本名  自己取的名

调用变量时,自己取的名.变量

otherteacher(自己随便取的名).teacherjoints(变量名)

在unity面板中将挂载脚本的物体拖入公开的物体的变量中

猜你喜欢

转载自blog.csdn.net/qq_52058429/article/details/125856607
今日推荐