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 = null;
collider.sharedMesh = colliderMesh;
}
}
时间: 2024-11-04 14:25:04