style : Code text indent format

This commit is contained in:
hevinci
2023-12-21 19:10:46 +08:00
parent 5c1d316d67
commit 544832c46a
117 changed files with 14101 additions and 14103 deletions
@@ -3,101 +3,101 @@ using UnityEngine;
namespace YooAsset
{
internal class ResourceLoader
{
private IDecryptionServices _decryption;
private IDeliveryLoadServices _delivery;
internal class ResourceLoader
{
private IDecryptionServices _decryption;
private IDeliveryLoadServices _delivery;
public void Init(IDecryptionServices decryption, IDeliveryLoadServices delivery)
{
_decryption = decryption;
_delivery = delivery;
}
public void Init(IDecryptionServices decryption, IDeliveryLoadServices delivery)
{
_decryption = decryption;
_delivery = delivery;
}
/// <summary>
/// 同步加载资源包对象
/// </summary>
public AssetBundle LoadAssetBundle(BundleInfo bundleInfo, string fileLoadPath, out Stream managedStream)
{
managedStream = null;
if (bundleInfo.Bundle.Encrypted)
{
if (_decryption == null)
{
YooLogger.Error($"{nameof(IDecryptionServices)} is null ! when load asset bundle {bundleInfo.Bundle.BundleName}!");
return null;
}
/// <summary>
/// 同步加载资源包对象
/// </summary>
public AssetBundle LoadAssetBundle(BundleInfo bundleInfo, string fileLoadPath, out Stream managedStream)
{
managedStream = null;
if (bundleInfo.Bundle.Encrypted)
{
if (_decryption == null)
{
YooLogger.Error($"{nameof(IDecryptionServices)} is null ! when load asset bundle {bundleInfo.Bundle.BundleName}!");
return null;
}
DecryptFileInfo fileInfo = new DecryptFileInfo();
fileInfo.BundleName = bundleInfo.Bundle.BundleName;
fileInfo.FileLoadPath = fileLoadPath;
fileInfo.ConentCRC = bundleInfo.Bundle.UnityCRC;
return _decryption.LoadAssetBundle(fileInfo, out managedStream);
}
else
{
return AssetBundle.LoadFromFile(fileLoadPath);
}
}
DecryptFileInfo fileInfo = new DecryptFileInfo();
fileInfo.BundleName = bundleInfo.Bundle.BundleName;
fileInfo.FileLoadPath = fileLoadPath;
fileInfo.ConentCRC = bundleInfo.Bundle.UnityCRC;
return _decryption.LoadAssetBundle(fileInfo, out managedStream);
}
else
{
return AssetBundle.LoadFromFile(fileLoadPath);
}
}
/// <summary>
/// 异步加载资源包对象
/// </summary>
public AssetBundleCreateRequest LoadAssetBundleAsync(BundleInfo bundleInfo, string fileLoadPath, out Stream managedStream)
{
managedStream = null;
if (bundleInfo.Bundle.Encrypted)
{
if (_decryption == null)
{
YooLogger.Error($"{nameof(IDecryptionServices)} is null ! when load asset bundle {bundleInfo.Bundle.BundleName}!");
return null;
}
/// <summary>
/// 异步加载资源包对象
/// </summary>
public AssetBundleCreateRequest LoadAssetBundleAsync(BundleInfo bundleInfo, string fileLoadPath, out Stream managedStream)
{
managedStream = null;
if (bundleInfo.Bundle.Encrypted)
{
if (_decryption == null)
{
YooLogger.Error($"{nameof(IDecryptionServices)} is null ! when load asset bundle {bundleInfo.Bundle.BundleName}!");
return null;
}
DecryptFileInfo fileInfo = new DecryptFileInfo();
fileInfo.BundleName = bundleInfo.Bundle.BundleName;
fileInfo.FileLoadPath = fileLoadPath;
fileInfo.ConentCRC = bundleInfo.Bundle.UnityCRC;
return _decryption.LoadAssetBundleAsync(fileInfo, out managedStream);
}
else
{
return AssetBundle.LoadFromFileAsync(fileLoadPath);
}
}
DecryptFileInfo fileInfo = new DecryptFileInfo();
fileInfo.BundleName = bundleInfo.Bundle.BundleName;
fileInfo.FileLoadPath = fileLoadPath;
fileInfo.ConentCRC = bundleInfo.Bundle.UnityCRC;
return _decryption.LoadAssetBundleAsync(fileInfo, out managedStream);
}
else
{
return AssetBundle.LoadFromFileAsync(fileLoadPath);
}
}
/// <summary>
/// 同步加载分发的资源包对象
/// </summary>
public AssetBundle LoadDeliveryAssetBundle(BundleInfo bundleInfo, string fileLoadPath)
{
if (_delivery == null)
throw new System.Exception("Should never get here !");
/// <summary>
/// 同步加载分发的资源包对象
/// </summary>
public AssetBundle LoadDeliveryAssetBundle(BundleInfo bundleInfo, string fileLoadPath)
{
if (_delivery == null)
throw new System.Exception("Should never get here !");
// 注意:对于已经加密的资源包,需要开发者自行解密。
DeliveryFileInfo fileInfo = new DeliveryFileInfo();
fileInfo.BundleName = bundleInfo.Bundle.BundleName;
fileInfo.FileLoadPath = fileLoadPath;
fileInfo.ConentCRC = bundleInfo.Bundle.UnityCRC;
fileInfo.Encrypted = bundleInfo.Bundle.Encrypted;
return _delivery.LoadAssetBundle(fileInfo);
}
// 注意:对于已经加密的资源包,需要开发者自行解密。
DeliveryFileInfo fileInfo = new DeliveryFileInfo();
fileInfo.BundleName = bundleInfo.Bundle.BundleName;
fileInfo.FileLoadPath = fileLoadPath;
fileInfo.ConentCRC = bundleInfo.Bundle.UnityCRC;
fileInfo.Encrypted = bundleInfo.Bundle.Encrypted;
return _delivery.LoadAssetBundle(fileInfo);
}
/// <summary>
/// 异步加载分发的资源包对象
/// </summary>
public AssetBundleCreateRequest LoadDeliveryAssetBundleAsync(BundleInfo bundleInfo, string fileLoadPath)
{
if (_delivery == null)
throw new System.Exception("Should never get here !");
/// <summary>
/// 异步加载分发的资源包对象
/// </summary>
public AssetBundleCreateRequest LoadDeliveryAssetBundleAsync(BundleInfo bundleInfo, string fileLoadPath)
{
if (_delivery == null)
throw new System.Exception("Should never get here !");
// 注意:对于已经加密的资源包,需要开发者自行解密。
DeliveryFileInfo fileInfo = new DeliveryFileInfo();
fileInfo.BundleName = bundleInfo.Bundle.BundleName;
fileInfo.FileLoadPath = fileLoadPath;
fileInfo.ConentCRC = bundleInfo.Bundle.UnityCRC;
fileInfo.Encrypted = bundleInfo.Bundle.Encrypted;
return _delivery.LoadAssetBundleAsync(fileInfo);
}
}
// 注意:对于已经加密的资源包,需要开发者自行解密。
DeliveryFileInfo fileInfo = new DeliveryFileInfo();
fileInfo.BundleName = bundleInfo.Bundle.BundleName;
fileInfo.FileLoadPath = fileLoadPath;
fileInfo.ConentCRC = bundleInfo.Bundle.UnityCRC;
fileInfo.Encrypted = bundleInfo.Bundle.Encrypted;
return _delivery.LoadAssetBundleAsync(fileInfo);
}
}
}