AssetDatabase.GetAssetPathFromTextMetaFilePath

Switch to Manual
public static string GetAssetPathFromTextMetaFilePath (string path);

Description

Получает путь к текстовому файлу .meta, связанному с ассетом.

using System.IO;
using UnityEditor;
using UnityEngine;

public class AssetDatabaseExamples : MonoBehaviour { [MenuItem("AssetDatabase/Get All Assets With Meta File")] static void GetAllAssetsWithMetaFiles() { var files = Directory.GetFiles("Assets/", "*.meta", SearchOption.AllDirectories);

foreach (var file in files) { var path = AssetDatabase.GetAssetPathFromTextMetaFilePath(file); Debug.Log(path); } } }