碰撞体使用的材质。
如果材质被多个碰撞体共享,它将复制该材质并将其分配给碰撞体。
using UnityEngine;
public class Example : MonoBehaviour { // Expose properties in the inspector for easy adjustment. float dynFriction; float statFriction;
Collider coll;
void Start() { coll = GetComponent<Collider>();
coll.material.dynamicFriction = dynFriction; coll.material.staticFriction = statFriction; } }