Browse Source

Made tool to reposition Scene camera

Josh_Dev_branch
JoshuaReason 5 years ago
parent
commit
1943c2ee3c
2 changed files with 37 additions and 0 deletions
  1. +26
    -0
      Assets/Editor/SceneCameraEditor.cs
  2. +11
    -0
      Assets/Editor/SceneCameraEditor.cs.meta

+ 26
- 0
Assets/Editor/SceneCameraEditor.cs View File

@ -0,0 +1,26 @@
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();
}
}

+ 11
- 0
Assets/Editor/SceneCameraEditor.cs.meta View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7ea71f95ed23b69458472a57b2827284
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Loading…
Cancel
Save