获取摄像机视图窗口区域: camera.ViewportToWorldPoint (new Vector3 (0, 1, 10.0f))
void OnDrawGizmosSelected(){ print (camera.ViewportToWorldPoint (new Vector3 (0, 1, camera.farClipPlane))); Vector3 p = camera.ViewportToWorldPoint (new Vector3 (0, 0, camera.farClipPlane)); Gizmos.color = Color.yellow; Gizmos.DrawSphere (p, 1f); }
http://www.xuanyusong.com/archives/3036 http://game.ceeger.com/Script/Camera/Camera.ViewportToWorldPoint.html
时间: 2024-10-01 01:29:29