Collider.material 材质

var material : PhysicMaterial

Description描述

The material used by the collider.

碰撞器使用的材质。

If material is shared by colliders, it will duplicate the material and assign it to the collider.

如果材质被碰撞器共享,它将复制材质并指定给碰撞器。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public void Awake() {
		collider.material.dynamicFriction = 0;
		collider.material.staticFriction = 0;
	}
}
// Makes the collider act like ice.
//让碰撞器像冰一样
collider.material.dynamicFriction = 0;
collider.material.staticFriction = 0;
Page last updated: 2010-12-12