Created
October 7, 2019 04:05
-
-
Save momadacoding/d191ac09ffda97b33d1d77d9b6dd1b2c to your computer and use it in GitHub Desktop.
Unity UI easy pivot view
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 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