概要
using UnityEditor; using UnityEngine; public static class Example { [MenuItem( "Tools/Hoge" )] private static void Hoge() { var path = "Assets/Prefab.prefab"; // 従来:string 型で GUID を取得 var guidString = AssetDatabase.AssetPathToGUID( path ); Debug.Log( guidString ); // 新機能:GUID 型で GUID を取得 var guid = AssetDatabase.GUIDFromAssetPath( path ); Debug.Log( guid ); } }