perf : 异常处理替换为YOO的异常类

This commit is contained in:
何冠峰
2025-12-05 15:45:04 +08:00
parent 5da8c6baf8
commit e5d0a856a5
27 changed files with 243 additions and 74 deletions
@@ -156,7 +156,7 @@ namespace YooAsset
private BundleInfo CreateBundleInfo(PackageBundle packageBundle)
{
if (packageBundle == null)
throw new Exception("Should never get here !");
throw new YooInternalException();
var fileSystem = GetBelongFileSystem(packageBundle);
if (fileSystem != null)
@@ -165,12 +165,12 @@ namespace YooAsset
return bundleInfo;
}
throw new Exception($"Can not found belong file system : {packageBundle.BundleName}");
throw new YooFileSystemException($"Can not found belong file system : {packageBundle.BundleName}");
}
BundleInfo IBundleQuery.GetMainBundleInfo(AssetInfo assetInfo)
{
if (assetInfo == null || assetInfo.IsInvalid)
throw new Exception("Should never get here !");
throw new YooInternalException();
// 注意:如果清单里未找到资源包会抛出异常!
var packageBundle = ActiveManifest.GetMainPackageBundle(assetInfo.Asset);
@@ -179,7 +179,7 @@ namespace YooAsset
List<BundleInfo> IBundleQuery.GetDependBundleInfos(AssetInfo assetInfo)
{
if (assetInfo == null || assetInfo.IsInvalid)
throw new Exception("Should never get here !");
throw new YooInternalException();
// 注意:如果清单里未找到资源包会抛出异常!
List<PackageBundle> depends;