Version: 2017.1
public PhysicMaterial material ;

描述

碰撞体使用的材质。

如果碰撞体共用材质, 则它将复制该材质,然后将其分配到该碰撞体。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public float dynFriction; public float statFriction; public Collider coll; void Start() { coll = GetComponent<Collider>(); coll.material.dynamicFriction = dynFriction; coll.material.staticFriction = statFriction; } }