gameObject.GetComponentlt;TerrainCollider;().material = Resources.Load(xxx) as PhysicMaterial; 把材质拖到Resources下,xxx为材质路径名。