Cloth.thickness 厚度

var thickness : float

Description描述

The thickness of the cloth surface.

布料表面的厚度

This is the distance kept between any cloth vertex and and other collider (or other cloth vertex if self-collision is enabled). Any object closer then this distance will collide with the cloth. If this value is too low, you may see the edges of objects intersecting the cloth surface. If this value is too high, you may see noticable distance between the cloth surface and colliding objects or stiffness in cloth motion if self-collision is enabled. Must be larger then zero.

这是用来控制布料物体和碰撞物体(或者是布料物体,如果开启自身碰撞的话)之间距离的参数。任何一个物体与布料物体的距离接近这个值,那么则会产生碰撞。如果这个值过低,物体边缘会与布料表面交叉;如果该值太高,会明显看到布料与碰撞物体自己的缝隙,或者布料物体在开启自身碰撞时,运动不自然。这个值必须在0~1之间。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public void Awake() {
		transform.GetComponent<Cloth>().thickness = 0.2F;
	}
}
transform.GetComponent(Cloth).thickness = 0.2;
最后修改:2011年1月18日 Tuesday 21:25

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。