using UnityEngine;
using System.Collections;
public class dynaMesh : MonoBehaviour {
public SkinnedMeshRenderer meshRenderer;
public MeshCollider collider;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
Mesh colliderMesh = new Mesh();//内存泄漏
meshRenderer.BakeMesh(colliderMesh);
collider.sharedMesh=colliderMesh;
}
}