Skip to content

Instantly share code, notes, and snippets.

@arkms
Created June 1, 2016 03:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arkms/ce719d7da73ed6aca2b29f957dc1a4ad to your computer and use it in GitHub Desktop.
Save arkms/ce719d7da73ed6aca2b29f957dc1a4ad to your computer and use it in GitHub Desktop.
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