Merge branch 'tuyoogame:dev' into dev

pull/342/head
miuleung 2024-08-14 15:15:50 +08:00 committed by GitHub
commit 40ef17edcd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -42,6 +42,12 @@ namespace YooAsset.Editor
AssetPath = assetPath;
AssetGUID = UnityEditor.AssetDatabase.AssetPathToGUID(AssetPath);
AssetType = UnityEditor.AssetDatabase.GetMainAssetTypeAtPath(AssetPath);
// 注意:如果资源文件损坏或者实例化关联脚本丢失,获取的资源类型会无效!
if (AssetType == null)
{
throw new Exception($"Found invalid asset : {AssetPath}");
}
}
/// <summary>