You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

26 lines
651 B

using UnityEngine;
using UnityEditor;
public class SceneViewCameraTest
{
[MenuItem("Tools/Move Scene To Camera #c")]
static public void MoveSceneViewCamera()
{
if(Camera.main == null)
{
Debug.LogError("No Main camera in scene");
return;
}
Vector3 position = Camera.main.transform.position;
Quaternion rotation = Camera.main.transform.rotation;
SceneView.lastActiveSceneView.size = 0.1f;
SceneView.lastActiveSceneView.rotation = rotation;
SceneView.lastActiveSceneView.pivot = position;
SceneView.lastActiveSceneView.Repaint();
}
}