using System.Collections; using System.Collections.Generic; using UnityEngine; public class SkinedMeshCollider : MonoBehaviour { public SkinnedMeshRenderer meshRenderer; public MeshCollider collider; void Update() { Mesh colliderMesh = new Mesh(); meshRenderer.BakeMesh(colliderMesh); //更新mesh collider.sharedMesh = null; collider.sharedMesh = colliderMesh; //将新的mesh赋给meshcollider } }