今天看书的时候看到一个获取脚本组件的示例
ppublic GameObject otherObject;
void Update(){
Test test = otherObject.GetComponent<Test>();
test.dosomething();
}
public void dosomething(){
this.transform.Rotate(1,0,0);
}
然后将这两个脚本分别挂载到两个cube上
其他的我都理解,就是第一个脚本中的
Test test = otherObject.GetComponent<Test>();
第一个大写的Test是什么意思呀?
关于GetComponent这一个的用法我也不怎么懂
🙏🙏🙏