Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Make the Scene view move and follow a camara (2D)
#define AUTO_SCENEVIEW //Comentar para dejar de perseguir y poder controlar la pestaña de escena en modo Play
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class sceneview_follow : MonoBehaviour
{
#if UNITY_EDITOR && AUTO_SCENEVIEW
void Update ()
{
if (SceneView.lastActiveSceneView != null)
{
SceneView.lastActiveSceneView.pivot = camTrans.position;
SceneView.lastActiveSceneView.Repaint();
}
}
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment