GetAssetPathFromTextMetaFilePath(string)
Gets the path to the asset file associated with a text.meta file.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEditor
- Assembly: UnityEditor
public static string GetAssetPathFromTextMetaFilePath(string path)
Parameters
The .meta file name.
Returns
Type | Description |
|---|---|
| string |
Examples
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); } } }