Cloth.externalAcceleration 外力

var externalAcceleration : Vector3


A constant, external acceleration applied to the cloth.


Use this to simulate constant forces on the cloth, such as wind waving a flag.


参考: Cloth.randomAcceleration , InteractiveCloth.AddForceAtPosition

using UnityEngine;

using System.Collections;

public class example : MonoBehaviour {

	public void Awake() {

		transform.GetComponent<Cloth>().externalAcceleration = -Physics.gravity / 2;


// Make this cloth fall at half speed (if is affected by gravity).


transform.GetComponent(Cloth).externalAcceleration =  -Physics.gravity/2;

Page last updated: 2011-1-18