yoo2.2,9
This commit is contained in:
Alex-Rachel
2025-01-25 13:46:17 +08:00
parent 634a392a1f
commit 6166fd24c6
584 changed files with 15684 additions and 11714 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>