Cloth.externalAcceleration 外力

var externalAcceleration : Vector3

Description描述

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