Advertisement
DanTreble

SceneViewHelper.cs

Jun 25th, 2019
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.38 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEditor;
  3.  
  4. public class SceneViewHelper : Editor
  5. {
  6.     [MenuItem("Custom/Scene View/Match main camera %#M")]
  7.     static void MatchMainCamera()
  8.     {
  9.         var camera = GameObject.FindWithTag("MainCamera");
  10.  
  11.         if (camera != null)
  12.         {
  13.             SceneView.lastActiveSceneView.AlignViewToObject(camera.transform);
  14.         }
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement