Skip to content

Instantly share code, notes, and snippets.

@luvcraft
luvcraft / GetObjectPath.cs
Last active August 19, 2025 18:04
For Unity. Adds a "Get Path" option to the GameObject right-click context menu, that logs the object's path to the console
using ExtensionToolbox;
using UnityEditor;
using UnityEngine;
/// <summary>
/// A class for Unity containing a method to get the path to a GameObject via the right-click menu
/// to use it, right-click on a GameObject and choose "Get Path" from the context menu
///
/// This script uses "Extension Toolbox", a super-handy collection of extension methods
/// for Unity that I've written over the years.