Skip to content

Instantly share code, notes, and snippets.

@fuqunaga
Created June 13, 2023 08:24
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 fuqunaga/df0869c0a4969fe954edc4f0ef7d814e to your computer and use it in GitHub Desktop.
Save fuqunaga/df0869c0a4969fe954edc4f0ef7d814e to your computer and use it in GitHub Desktop.
PingObjectShortcut
using UnityEditor;
using UnityEngine;
public static class PingObjectShortcut
{
private const string MenuPath = "Tools/Ping/";
[MenuItem(MenuPath + "MainCamera #&c")]
private static void PingMainCamera()
{
var camera = GameObject.FindGameObjectWithTag("MainCamera");
if (camera != null)
{
EditorGUIUtility.PingObject(camera);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment