function OnMouseDown () {
var hinges : HingeJoint[] = FindObjectsOfType(HingeJoint) as HingeJoint[];
for (var hinge : HingeJoint in hinges) {
hinge.useSpring = false;
}
}

----------------------------------------------------

//将场景中所有模型名写入数组getAllName
var getAllName = new Array ();
function Start()
{
 var hinges : GameObject[] = FindObjectsOfType(GameObject) as GameObject[];
 for (var hinge : GameObject in hinges)
 {
  getAllName.Push(hinge.name);
 }
 print(getAllName);
 print(getAllName.length);
}

function Update()
{
}

相关文章:

  • 2022-12-23
  • 2021-10-28
  • 2021-05-26
  • 2022-12-23
  • 2021-10-28
  • 2022-12-23
  • 2021-08-23
  • 2022-12-23
猜你喜欢
  • 2021-08-21
  • 2022-01-09
  • 2021-06-05
  • 2022-12-23
  • 2021-10-14
  • 2022-12-23
  • 2021-05-01
相关资源
相似解决方案