Skip to content

Instantly share code, notes, and snippets.

@haolly
Created October 7, 2019 04:05
Show Gist options
  • Save haolly/d191ac09ffda97b33d1d77d9b6dd1b2c to your computer and use it in GitHub Desktop.
Save haolly/d191ac09ffda97b33d1d77d9b6dd1b2c to your computer and use it in GitHub Desktop.
Unity UI easy pivot view
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class FocusOnPivot : MonoBehaviour {
[MenuItem("Edit/Focus on Selected Pivot %g")]
static void Focus()
{
GameObject go = Selection.activeGameObject;
if (go!=null)
{
SceneView.lastActiveSceneView.LookAt(go.transform.position);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment