TEngine 6

This commit is contained in:
Alex-Rachel
2025-03-07 23:09:46 +08:00
parent aad8ff3ee5
commit 551727687f
1988 changed files with 46223 additions and 94880 deletions

View File

@@ -5,7 +5,7 @@ using System.Collections.Generic;
namespace YooAsset.Editor
{
[Serializable]
public class AssetInfo
public class AssetInfo : IComparable<AssetInfo>
{
private string _fileExtension = null;
@@ -37,11 +37,18 @@ namespace YooAsset.Editor
}
}
public AssetInfo(string assetPath)
{
AssetPath = assetPath;
AssetGUID = UnityEditor.AssetDatabase.AssetPathToGUID(AssetPath);
AssetType = UnityEditor.AssetDatabase.GetMainAssetTypeAtPath(AssetPath);
// 注意:如果资源文件损坏或者实例化关联脚本丢失,获取的资源类型会无效!
if (AssetType == null)
{
throw new Exception($"Found invalid asset : {AssetPath}");
}
}
/// <summary>
@@ -54,5 +61,10 @@ namespace YooAsset.Editor
else
return false;
}
public int CompareTo(AssetInfo other)
{
return this.AssetPath.CompareTo(other.AssetPath);
}
}
}