📜  getcomponent - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:54.442000             🧑  作者: Mango

代码示例2
public Gameobject a; //this allows you to drag an object into a slot in the unity software
private transform b; //this is a variable that can only be assigned and altered in script

b = a.GetComponent(); //this finds the transform component of 'a' and assigns that to 'b'