要判断的物体身上需要添加一个碰撞盒或者带有MeshRenderer组件
//变量
private Camera camera;
private Plane[] planes;
private Bounds bounds;
bool IsVisible()
{
// 得到摄像机的六个面
planes = GeometryUtility.CalculateFrustumPlanes(camera);
// 判断边框bounds是否在六个面内
return GeometryUtility.TestPlanesAABB(planes, bounds);
}