首页 > 其他 > 详细

忽略模型本身之间的碰撞

时间:2017-10-24 15:20:22      阅读:221      评论:0      收藏:0      [点我收藏+]
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]);
    }
}

 

忽略模型本身之间的碰撞

原文:http://www.cnblogs.com/dsh20134584/p/7723669.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!