Guest User

Untitled

a guest
Sep 26th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEditor;
  3.  
  4. public class CopyAbsolutePath : MonoBehaviour {
  5.  
  6. [MenuItem("Assets/絶対パスをクリップボードにコピー", false)]
  7. static void Execute()
  8. {
  9. // get select GO full path
  10. int instanceID = Selection.activeInstanceID;
  11. string path = AssetDatabase.GetAssetPath(instanceID);
  12. string fullPath = System.IO.Path.GetFullPath(path);
  13.  
  14.  
  15. // copy clipboard
  16. GUIUtility.systemCopyBuffer = fullPath;
  17. Debug.Log("Copy clipboard : \n" + fullPath);
  18. }
  19. }
Add Comment
Please, Sign In to add comment