MeshCollider.convex 凸形

var convex : bool

Description描述

Use a convex collider from the mesh.

对这个网格使用凸碰撞器。

This means that if you have this set to true, your mesh collider wont have Holes or entrances. Convex meshes can collide with other convex colliders and non-convex meshes. Thus convex mesh colliders are suitable on rigidibodies, if you really need more detailed colliders than what the primitive colliders provide you with.

这个意思是,如果你已经设置这个属性为true,你的网格碰撞不会有洞或者入口。凸网格可以与其他的凸碰撞机和无凸碰撞的网格发生碰撞。因此凸碰撞适合于刚体,如果你真的需要比原始撞机为您提供

更详细的对撞机。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public void Awake() {
		transform.collider.convex = true;
	}
}
transform.collider.convex = true;
Page last updated: 2010-12-12