單項(xiàng)選擇題在Unity中,如何在代碼中啟用一個物體的碰撞器?()

A.GetComponent<Collider>().enabled =true;
B.GetComponent<Collider>().isTrigger =true;
C.GetComponent<Collider>().material =new PhysicMaterial ();
D.GetComponent<Collider>().size =new Vector3(1,1,1);


您可能感興趣的試卷

你可能感興趣的試題

1.單項(xiàng)選擇題在Unity中,如何檢測一個物體是否正在與另一個物體發(fā)生碰撞?()

A.OnCollisionEnter (Collider other)
B.OnTriggerEnter (Collider other)
C.OnCollisionStay (Collider other)
D.OnTriggerStay (Collider other)

2.單項(xiàng)選擇題在Unity中,如何檢測鼠標(biāo)左鍵是否被按下并拖動?()

A.Input.GetMouseButton (0)&&Input.GetMouseButtonUp (0)
B.Input.GetMouseButton (0)&&Input.GetMouseButtonDown (0)
C.Input.GetMouseButton (0)&&!Input.GetMouseButtonUp (0)
D.Input.GetMouseButton (0)&&!Input.GetMouseButtonDown (0)

3.單項(xiàng)選擇題在Unity中,如何檢測鼠標(biāo)滾輪是否被滾動?()

A.Input.GetAxis ("Mouse X")
B.Input.GetAxis ("Mouse Y")
C.Input.GetAxis ("Mouse ScrollWheel")
D.Input.GetAxis ("Mouse Scroll")

4.單項(xiàng)選擇題在Unity中,如何檢測鼠標(biāo)右鍵是否被按下?()

A.Input.GetMouseButton (0)
B.Input.GetMouseButton (1)
C.Input.GetMouseButton (2)
D.Input.GetMouseButtonDown (1)

5.單項(xiàng)選擇題在Unity中,如何獲取一個GameObject對象的父對象?()

A.GetComponentInParent< Transform>()
B.GetParent ()
C.FindParent ()
D.gameObject.transform.parent