A物体有CameraB渲染,首先将A物体世界坐标转换为屏幕坐标,再由屏幕坐标的x与Screen.width做比较,如果x<Screen.width则在屏幕内,否则在屏幕外。Vector3 screen3dPos = CameraB.WorldToScreenPoint(enemy.transform.position);if (screen3dPos.x > Screen.width)
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号