Collider.sharedMaterial 共享材质
var sharedMaterial : PhysicMaterial
Description描述
The shared physic material of this collider.
碰撞器的共享物理材质。
Modifying this material will change the surface properties of all colliders using the material. In most cases you want to modify Collider.material instead.
修改材质将改变所有碰撞器使用该材质的表面属性,大多数情况下你可以修改Collider.material替代。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public PhysicMaterial material;
public void Awake() {
collider.sharedMaterial = material;
}
}
var material : PhysicMaterial;
collider.sharedMaterial = material;
最后修改:2010年12月12日 Sunday 2:56