refactor : 重构代码
This commit is contained in:
@@ -91,7 +91,7 @@ namespace YooAsset
|
||||
|
||||
// 检测重复初始化
|
||||
if (_initializeOp != null)
|
||||
throw new YooPackageException(PackageName, $"Resource package '{PackageName}' is already initialized!");
|
||||
throw new YooPackageException(PackageName, $"Resource package '{PackageName}' is already initialized.");
|
||||
|
||||
// 开始初始化操作
|
||||
_initializeOp = new InitializePackageOperation(this, options);
|
||||
@@ -149,7 +149,7 @@ namespace YooAsset
|
||||
// 注意:强烈建议在更新之前保持加载器为空!
|
||||
if (_resourceManager.HasAnyLoader())
|
||||
{
|
||||
YooLogger.Warning($"Found loaded bundle before update manifest ! Recommended to call the {nameof(UnloadAllAssetsAsync)} method to release loaded bundle !");
|
||||
YooLogger.Warning($"Found loaded bundle before update manifest. Recommended to call the {nameof(UnloadAllAssetsAsync)} method to release loaded bundle.");
|
||||
}
|
||||
|
||||
var operation = new LoadPackageManifestOperation(_fileSystemHost, options);
|
||||
@@ -891,23 +891,23 @@ namespace YooAsset
|
||||
{
|
||||
if (InitializeStatus == EOperationStatus.None)
|
||||
{
|
||||
throw new YooPackageException(PackageName, "Resource package not initialized!");
|
||||
throw new YooPackageException(PackageName, "Resource package not initialized.");
|
||||
}
|
||||
else if (InitializeStatus == EOperationStatus.Processing)
|
||||
{
|
||||
throw new YooPackageException(PackageName, "Resource package initialization not completed!");
|
||||
throw new YooPackageException(PackageName, "Resource package initialization not completed.");
|
||||
}
|
||||
else if (InitializeStatus == EOperationStatus.Failed)
|
||||
{
|
||||
string error = _initializeOp == null ? string.Empty : _initializeOp.Error;
|
||||
throw new YooPackageException(PackageName, $"Resource package initialization failed! Error: {error}");
|
||||
throw new YooPackageException(PackageName, $"Resource package initialization failed. Error: {error}");
|
||||
}
|
||||
}
|
||||
|
||||
if (checkActiveManifest)
|
||||
{
|
||||
if (_fileSystemHost.ActiveManifest == null)
|
||||
throw new YooPackageException(PackageName, "Cannot found active package manifest!");
|
||||
throw new YooPackageException(PackageName, "Cannot found active package manifest.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user