主要用到APISceneView.lastActiveSceneView.camera
Game视图与Scene视图相机同步
Camera.main.transform.SetPositionAndRotation(SceneView.lastActiveSceneView.camera.transform.position, SceneView.lastActiveSceneView.camera.transform.rotation);
Scene视图与Game视图相机同步
Camera cameraMain = Camera.main;
var sceneView = SceneView.lastActiveSceneView;
if (sceneView != null)
{
sceneView.cameraSettings.nearClip = cameraMain.nearClipPlane;
sceneView.cameraSettings.fieldOfView = cameraMain.fieldOfView;
sceneView.pivot = cameraMain.transform.position +
cameraMain.transform.forward * sceneView.cameraDistance;
sceneView.rotation = cameraMain.transform.rotation;
}
Comments | NOTHING
该文章已经关闭评论