Created
March 12, 2016 19:53
-
-
Save ousttrue/754c00933cf3ba22a348 to your computer and use it in GitHub Desktop.
Unity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
#endif | |
[ExecuteInEditMode] | |
public class EditorCamera : MonoBehaviour { | |
// Update is called once per frame | |
void OnRenderObject () { | |
#if UNITY_EDITOR | |
if (SceneView.lastActiveSceneView == null) return; | |
var camera = SceneView.lastActiveSceneView.camera; | |
transform.position=camera.transform.position; | |
transform.rotation = camera.transform.rotation; | |
#endif | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment