Cloth.randomAcceleration 随机外力


var randomAcceleration : Vector3

Description描述

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

  • C#

  • JavaScript

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.  //模仿来自X轴向上的风  transform.GetComponent(Cloth).randomAcceleration = Vector3 (10, 0, 0);


,