collider.attachedrigidbody 附加刚体

2015-1-4 16:27| 发布者: 杨炎| 查看: 1904| 评论: 0|原作者: 蛮牛|来自: yzc88亚洲城脚本manual

摘要: collider.attachedrigidbody 附加刚体varattachedrigidbody: rigidbodydescription描述the rigidbody the collider is attached to.碰撞器附加的刚体。returns null if the collider is attached to no rigidbody.如 ...

collider.attachedrigidbody 附加刚体

varattachedrigidbody: rigidbody

description描述

the rigidbody the collider is attached to.

碰撞器附加的刚体。

returns null if the collider is attached to no rigidbody.

如果碰撞器没有附加刚体返回null。

colliders are automatically connected to the rigidbody attached to the same game object or attached to any parent game object.

碰撞器被自动连接到刚体,刚体附加在相同游戏物体或附加在父游戏物体。

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

public void awake() {

collider.attachedrigidbody.addforce(0, 100, 0);

}

}

// lift the rigidbody attached to the collider.

//升起附加在碰撞器的刚体

collider.attachedrigidbody.addforce(0,100,0);

相关阅读

文章点评
相关文章