Cloth.randomAcceleration 随机外力

var randomAcceleration : Vector3


A random, external acceleration applied to the cloth.


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


参考:Cloth.externalAcceleration, InteractiveCloth.AddForceAtPosition

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public void Awake() {
		transform.GetComponent<Cloth>().randomAcceleration = new Vector3(10, 0, 0);
// Simulate wind going trough the X axis.  

transform.GetComponent(Cloth).randomAcceleration = Vector3 (10, 0, 0);

Page last updated: 2011-1-18