言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

InteractiveCloth.AttachToCollider

Switch to Manual
public function AttachToCollider(collider: Collider, tearable: bool = false, twoWayInteraction: bool = false): void;

Description

布オブジェクトにコライダをアタッチします

Only has an effect if some vertices of the cloth are intersecting the collider. These vertices will then become static in their position with respect to the collider. If tearable is true, attachments can tear of, depending on the value of attachmentTearFactor. If twoWayInteraction is true, the cloth will apply forces back to the attached rigidbody, depending on the value of attachmentResponse. See Also: DetachFromCollider 関数

	// Attach this transform's collider to a cloth, make 
	// it tearable and two way interactive on forces.
	// REMEMBER: Only has an effect if some vertices of 
	// the cloth are intersecting the collider

	var cloth : InteractiveCloth;

	function Start() {
		if(cloth)
			cloth.AttachToCollider(transform.collider, true, true);
		else
			Debug.LogError("No cloth was assigned in the inspector");
	}