忽略模型本身之间的碰撞
using UnityEngine; using System.Collections; /// <summary> /// 忽略模型本身之间的碰撞 /// </summary> public class IgnoreInternalCollisions : MonoBehaviour { void Start () { Collider[] colliders = gameObject.GetComponentsInChildren<Collider>(); for (int i = 0; i < colliders.Length; ++i) for (int j = i + 1; j < colliders.Length; ++j) Physics.IgnoreCollision(colliders[i], colliders[j]); } }