Version: 2021.2
언어: 한국어
public static GUID GUIDFromAssetPath (string path);

파라미터

path Filesystem path for the asset. All paths are relative to the project folder.

반환

GUID The GUID of the asset. An all-zero GUID denotes an invalid asset path.

설명

Get the GUID for the asset at path.

All paths are relative to the project folder, for example: "Assets/MyTextures/hello.png".

using UnityEngine;
using UnityEditor;

public static class Example { [MenuItem("AssetDatabase/GUIDFromAssetPath")] static void Doit() { GUID t = AssetDatabase.GUIDFromAssetPath("Assets/texture.jpg"); Debug.Log(t.ToString()); } }