AssetPathPrinter

From Unify Community Wiki
Jump to: navigation, search

Author: Dave Buchhofer

Description

Simple editor script that will copy the path to any selected project pane item to the clipboard, and also print to the console.

Usage

Place this script in YourProject/Assets/Editor and the menu items will appear in Custom \ Selection \ Print Asset Location, currently it is set to use a hotkey Control-J.

C# - AssetLocPrinter.cs

using UnityEngine;
using UnityEditor;
 
public class AssetLocPrinter : ScriptableObject {
	[MenuItem ("Custom/Selection/Print Asset Location %j")]
	static void CopyAssetLocations() {
		string path=string.Empty;
		foreach (Object o in Selection.objects)
		{
			path += "\n" + AssetDatabase.GetAssetPath(o);
		}
		Debug.Log(path);
		EditorGUIUtility.systemCopyBuffer = path;
    }
}
Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox