Skip to content

Instantly share code, notes, and snippets.

@ninpl
Created February 21, 2017 16:26
Show Gist options
  • Save ninpl/6a55b9fc1fa66cb664027d7b9f2c15f1 to your computer and use it in GitHub Desktop.
Save ninpl/6a55b9fc1fa66cb664027d7b9f2c15f1 to your computer and use it in GitHub Desktop.
Herramienta para Unity3d. Clic derecho en un asset -> Copy Asset Path. - ideal para usar con AssetDatabase.LoadAssetAtPath <>
// ┌∩┐(◣_◢)┌∩┐
// \\
// Singleton.cs (21/02/2017) \\
// Autor: Antonio Mateo (Moon Pincho) \\
// Descripcion: Herramienta para copiar la ruta \\
// Fecha Mod: 21/02/2017 \\
// Ultima Mod: Version inicial \\
//******************************************************************************\\
using UnityEngine;
using UnityEditor;
public static class CopyAssetPathContext
{
[MenuItem("Assets/Copy Asset Path")]
public static void CopyAssetPath()
{
if (Selection.activeObject != null)
{
string assetPath = AssetDatabase.GetAssetPath(Selection.activeObject);
EditorGUIUtility.systemCopyBuffer = assetPath;
Debug.Log("Copiado en Buffer:" + assetPath);
}
else
{
Debug.Log("Nada seleccionado.");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment