Пример #1
0
 /// <summary>
 /// 是否碰撞
 /// </summary>
 /// <param name="object1"></param>
 /// <param name="object2"></param>
 public void IsCollide(CollisionObject object1, CollisionObject object2)
 {
     if (Mathf.Abs(object1.center.x - object2.center.x) <= object1.haflSize.x + object2.haflSize.x &&
         Mathf.Abs(object1.center.z - object2.center.z) <= object1.haflSize.z + object2.haflSize.z)
     {
         object1.Collide(object2);
         object2.Collide(object1);
     }
 }