获取工程中文件的绝对路径

[MenuItem("Tools/GetSelectPaths")]
public static void Execute()
{
string[] strs = Selection.assetGUIDs;
var curPath = System.IO.Directory.GetCurrentDirectory();
foreach (var item in strs)
{
string path = AssetDatabase.GUIDToAssetPath(item);
Debug.Log(curPath+"/"+path);
}
}

posted @ 2023-04-01 14:37  钢与铁  阅读(14)  评论(0编辑  收藏  举报