Version: 2021.3
언어: 한국어

Provider.GetAssetByGUID

매뉴얼로 전환
public static VersionControl.Asset GetAssetByGUID (string guid);

파라미터

guid GUID of asset.

설명

Returns version control information about an asset from a given GUID.

Returns null if the GUID is not known by the Unity Editor.

using System.Collections.Generic;
using UnityEditor;
using UnityEditor.VersionControl;
using UnityEngine;

public class EditorScript : MonoBehaviour { [MenuItem("Version Control/GetAssetByGUID")] static void ExampleGetAssetByGUID() { string guid = AssetDatabase.AssetPathToGUID("Assets/ExampleAsset.mat"); AssetList assets = new AssetList(); assets.Add(Provider.GetAssetByGUID(guid)); Debug.Log("Found an asset: " + assets[0].name.ToString()); } }