InteractiveCloth.DetachFromCollider 分离碰撞器
function DetachFromCollider (collider : Collider) : void
Description描述
Detaches a collider from the cloth object.
从布料物体分离一个碰撞器。
参见: AttachToCollider函数
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public string colliderName = "GameObject collider";
void Start() {
Collider colliderToRemove = GameObject.Find(colliderName) as Collider;
transform.GetComponent().DetachFromCollider(colliderToRemove);
}
}
// Delete a collider that is attached to this transform's cloth
// by searching for its name.
//删除附加到这个变换布料的一个碰撞器,通过搜索它的名字
var colliderName = "GameObject collider";
function Start() {
var colliderToRemove : Collider = GameObject.Find(colliderName) as Collider;
transform.GetComponent(InteractiveCloth).DetachFromCollider(colliderToRemove);
}
最后修改:2011年3月27日 Sunday 19:20