Compare commits

..

5 Commits

Author SHA1 Message Date
hevinci 19c46a2f60 update runtime code
1. 移除了LoadSceneAsync方法里的activateOnLoad参数
2023-06-27 15:04:47 +08:00
hevinci f54c8d6da4 update editor code
1. 移除了BuildParameters.AutoAnalyzeRedundancy字段
2. 移除了DefaultShareAssetPackRule
3. 新增了ZeroRedundancySharedPackRule
4. 新增了FullRedundancySharedPackRule
2023-06-27 14:18:54 +08:00
hevinci 84f9d1985e update editor code
1. IShareAssetPackRule重命名为ISharedPackRule
2. DefaultShareAssetPackRule重命名为DefaultSharedPackRule
2023-06-27 11:00:01 +08:00
hevinci 0b2a2bf97d update AssetBundleCollector 2023-06-27 10:40:09 +08:00
hevinci 561cf411ef update asset system 2023-06-27 10:28:16 +08:00
45 changed files with 161 additions and 159 deletions

View File

@ -275,8 +275,7 @@ namespace YooAsset.Editor
buildParameters.PackageName = AssetBundleBuilderSettingData.Setting.BuildPackage;
buildParameters.PackageVersion = _buildVersionField.value;
buildParameters.VerifyBuildingResult = true;
buildParameters.AutoAnalyzeRedundancy = true;
buildParameters.ShareAssetPackRule = new DefaultShareAssetPackRule();
buildParameters.SharedPackRule = new ZeroRedundancySharedPackRule();
buildParameters.EncryptionServices = CreateEncryptionServicesInstance();
buildParameters.CompressOption = AssetBundleBuilderSettingData.Setting.CompressOption;
buildParameters.OutputNameStyle = AssetBundleBuilderSettingData.Setting.OutputNameStyle;

View File

@ -164,7 +164,7 @@ namespace YooAsset.Editor
/// <summary>
/// 计算共享资源包的完整包名
/// </summary>
public void CalculateShareBundleName(IShareAssetPackRule packRule, bool uniqueBundleName, string packageName, string shadersBundleName)
public void CalculateShareBundleName(ISharedPackRule sharedPackRule, bool uniqueBundleName, string packageName, string shadersBundleName)
{
if (CollectorType != ECollectorType.None)
return;
@ -180,7 +180,7 @@ namespace YooAsset.Editor
{
if (_referenceBundleNames.Count > 1)
{
PackRuleResult packRuleResult = packRule.GetPackRuleResult(AssetPath);
PackRuleResult packRuleResult = sharedPackRule.GetPackRuleResult(AssetPath);
BundleName = packRuleResult.GetShareBundleName(packageName, uniqueBundleName);
}
else
@ -196,12 +196,9 @@ namespace YooAsset.Editor
/// </summary>
public bool IsRedundancyAsset()
{
if (CollectorType != ECollectorType.None)
if (HasBundleName())
return false;
if (IsRawAsset)
throw new Exception("Should never get here !");
return _referenceBundleNames.Count > 1;
}

View File

@ -49,7 +49,7 @@ namespace YooAsset.Editor
/// <summary>
/// 参与构建的资源列表
/// 注意:不包含零依赖资源
/// 注意:不包含零依赖资源和冗余资源
/// </summary>
public readonly List<BuildAssetInfo> AllMainAssets = new List<BuildAssetInfo>();
@ -149,7 +149,15 @@ namespace YooAsset.Editor
}
/// <summary>
/// 获取该资源包内的所有资源(包括零依赖资源)
/// 获取构建的资源路径列表
/// </summary>
public string[] GetAllMainAssetPaths()
{
return AllMainAssets.Select(t => t.AssetPath).ToArray();
}
/// <summary>
/// 获取该资源包内的所有资源(包括零依赖资源和冗余资源)
/// </summary>
public List<string> GetAllBuiltinAssetPaths()
{
@ -161,6 +169,7 @@ namespace YooAsset.Editor
continue;
foreach (var dependAssetInfo in assetInfo.AllDependAssetInfos)
{
// 注意:依赖资源里只添加零依赖资源和冗余资源
if (dependAssetInfo.HasBundleName() == false)
{
if (result.Contains(dependAssetInfo.AssetPath) == false)
@ -171,22 +180,6 @@ namespace YooAsset.Editor
return result;
}
/// <summary>
/// 获取构建的资源路径列表
/// </summary>
public string[] GetAllMainAssetPaths()
{
return AllMainAssets.Select(t => t.AssetPath).ToArray();
}
/// <summary>
/// 获取所有写入补丁清单的资源
/// </summary>
public BuildAssetInfo[] GetAllMainAssetInfos()
{
return AllMainAssets.Where(t => t.CollectorType == ECollectorType.MainAssetCollector).ToArray();
}
/// <summary>
/// 创建AssetBundleBuild类
/// </summary>
@ -200,6 +193,14 @@ namespace YooAsset.Editor
return build;
}
/// <summary>
/// 获取所有写入补丁清单的资源
/// </summary>
public BuildAssetInfo[] GetAllManifestAssetInfos()
{
return AllMainAssets.Where(t => t.CollectorType == ECollectorType.MainAssetCollector).ToArray();
}
/// <summary>
/// 创建PackageBundle类
/// </summary>

View File

@ -77,15 +77,10 @@ namespace YooAsset.Editor
/// </summary>
public bool VerifyBuildingResult = false;
/// <summary>
/// 自动分析冗余资源
/// </summary>
public bool AutoAnalyzeRedundancy = true;
/// <summary>
/// 共享资源的打包规则
/// </summary>
public IShareAssetPackRule ShareAssetPackRule = null;
public ISharedPackRule SharedPackRule = null;
/// <summary>
/// 资源的加密接口

View File

@ -74,14 +74,9 @@ namespace YooAsset.Editor
public bool UniqueBundleName;
/// <summary>
/// 自动分析冗余
/// 共享资源的打包规则类名
/// </summary>
public bool AutoAnalyzeRedundancy;
/// <summary>
/// 共享资源的打包类名称
/// </summary>
public string ShareAssetPackRuleClassName;
public string SharedPackRuleClassName;
/// <summary>
/// 加密服务类名称

View File

@ -139,7 +139,7 @@ namespace YooAsset.Editor
List<PackageAsset> result = new List<PackageAsset>(1000);
foreach (var bundleInfo in buildMapContext.Collection)
{
var assetInfos = bundleInfo.GetAllMainAssetInfos();
var assetInfos = bundleInfo.GetAllManifestAssetInfos();
foreach (var assetInfo in assetInfos)
{
PackageAsset packageAsset = new PackageAsset();

View File

@ -49,9 +49,8 @@ namespace YooAsset.Editor
buildReport.Summary.LocationToLower = buildMapContext.Command.LocationToLower;
buildReport.Summary.IncludeAssetGUID = buildMapContext.Command.IncludeAssetGUID;
buildReport.Summary.UniqueBundleName = buildMapContext.Command.UniqueBundleName;
buildReport.Summary.AutoAnalyzeRedundancy = buildParameters.AutoAnalyzeRedundancy;
buildReport.Summary.ShareAssetPackRuleClassName = buildParameters.ShareAssetPackRule == null ?
"null" : buildParameters.ShareAssetPackRule.GetType().FullName;
buildReport.Summary.SharedPackRuleClassName = buildParameters.SharedPackRule == null ?
"null" : buildParameters.SharedPackRule.GetType().FullName;
buildReport.Summary.EncryptionServicesClassName = buildParameters.EncryptionServices == null ?
"null" : buildParameters.EncryptionServices.GetType().FullName;
@ -161,7 +160,7 @@ namespace YooAsset.Editor
}
/// <summary>
/// 获取该资源包内的所有资源(包括零依赖资源)
/// 获取该资源包内的所有资源
/// </summary>
private List<string> GetAllBuiltinAssets(BuildMapContext buildMapContext, string bundleName)
{

View File

@ -26,10 +26,9 @@ namespace YooAsset.Editor
/// </summary>
public BuildMapContext CreateBuildMap(BuildParameters buildParameters)
{
EBuildMode buildMode = buildParameters.BuildMode;
string packageName = buildParameters.PackageName;
IShareAssetPackRule sharePackRule = buildParameters.ShareAssetPackRule;
bool autoAnalyzeRedundancy = buildParameters.AutoAnalyzeRedundancy;
var buildMode = buildParameters.BuildMode;
var packageName = buildParameters.PackageName;
var sharedPackRule = buildParameters.SharedPackRule;
Dictionary<string, BuildAssetInfo> allBuildAssetInfoDic = new Dictionary<string, BuildAssetInfo>(1000);
@ -100,18 +99,14 @@ namespace YooAsset.Editor
context.AssetFileCount = allBuildAssetInfoDic.Count;
context.Command = collectResult.Command;
// 8. 计算共享的资源包名
if (autoAnalyzeRedundancy)
{
// 8. 计算共享资源的包名
var command = collectResult.Command;
foreach (var buildAssetInfo in allBuildAssetInfoDic.Values)
{
buildAssetInfo.CalculateShareBundleName(sharePackRule, command.UniqueBundleName, command.PackageName, command.ShadersBundleName);
buildAssetInfo.CalculateShareBundleName(sharedPackRule, command.UniqueBundleName, command.PackageName, command.ShadersBundleName);
}
}
else
{
// 记录冗余资源
// 9. 记录冗余资源
foreach (var buildAssetInfo in allBuildAssetInfoDic.Values)
{
if (buildAssetInfo.IsRedundancyAsset())
@ -125,9 +120,8 @@ namespace YooAsset.Editor
context.RedundancyInfos.Add(redundancyInfo);
}
}
}
// 9. 移除不参与构建的资源
// 10. 移除不参与构建的资源
List<BuildAssetInfo> removeBuildList = new List<BuildAssetInfo>();
foreach (var buildAssetInfo in allBuildAssetInfoDic.Values)
{
@ -139,7 +133,7 @@ namespace YooAsset.Editor
allBuildAssetInfoDic.Remove(removeValue.AssetPath);
}
// 10. 构建资源包
// 11. 构建资源列表
var allPackAssets = allBuildAssetInfoDic.Values.ToList();
if (allPackAssets.Count == 0)
throw new Exception("构建的资源列表不能为空");
@ -147,6 +141,7 @@ namespace YooAsset.Editor
{
context.PackAsset(assetInfo);
}
return context;
}
private void RemoveZeroReferenceAssets(List<CollectAssetInfo> allCollectAssetInfos)

View File

@ -48,7 +48,7 @@ namespace YooAsset.Editor
}
// 检测共享资源打包规则
if (buildParameters.ShareAssetPackRule == null)
if (buildParameters.SharedPackRule == null)
throw new Exception("共享资源打包规则不能为空!");
#if UNITY_WEBGL

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 28c5def11c9035443b6251933ffa6a30
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -54,6 +54,10 @@ namespace YooAsset.Editor
/// </summary>
public string GetShareBundleName(string packageName, bool uniqueBundleName)
{
// 注意:冗余的共享资源包名返回空
if (string.IsNullOrEmpty(_bundleName) && string.IsNullOrEmpty(_bundleExtension))
return string.Empty;
string fullName;
string bundleName = EditorTools.GetRegularPath(_bundleName).Replace('/', '_').Replace('.', '_').ToLower();
if (uniqueBundleName)

View File

@ -4,7 +4,7 @@ namespace YooAsset.Editor
/// <summary>
/// 共享资源的打包规则
/// </summary>
public interface IShareAssetPackRule
public interface ISharedPackRule
{
/// <summary>
/// 获取打包规则结果

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a44aabee880cce943b52fe806464be0d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -20,7 +20,7 @@ namespace YooAsset.Editor
}
}
[DisplayName("定位地址: 分组名+文件名")]
[DisplayName("定位地址: 分组名_文件名")]
public class AddressByGroupAndFileName : IAddressRule
{
string IAddressRule.GetAssetAddress(AddressRuleData data)
@ -30,7 +30,7 @@ namespace YooAsset.Editor
}
}
[DisplayName("定位地址: 文件夹名+文件名")]
[DisplayName("定位地址: 文件夹名_文件名")]
public class AddressByFolderAndFileName : IAddressRule
{
string IAddressRule.GetAssetAddress(AddressRuleData data)

View File

@ -0,0 +1,31 @@
using System;
using System.IO;
using UnityEditor;
namespace YooAsset.Editor
{
/// <summary>
/// 零冗余的共享资源打包规则
/// </summary>
public class ZeroRedundancySharedPackRule : ISharedPackRule
{
public PackRuleResult GetPackRuleResult(string assetPath)
{
string bundleName = Path.GetDirectoryName(assetPath);
PackRuleResult result = new PackRuleResult(bundleName, DefaultPackRule.AssetBundleFileExtension);
return result;
}
}
/// <summary>
/// 全部冗余的共享资源打包规则
/// </summary>
public class FullRedundancySharedPackRule : ISharedPackRule
{
public PackRuleResult GetPackRuleResult(string assetPath)
{
PackRuleResult result = new PackRuleResult(string.Empty, string.Empty);
return result;
}
}
}

View File

@ -1,16 +0,0 @@
using System;
using System.IO;
using UnityEditor;
namespace YooAsset.Editor
{
public class DefaultShareAssetPackRule : IShareAssetPackRule
{
public PackRuleResult GetPackRuleResult(string assetPath)
{
string bundleName = Path.GetDirectoryName(assetPath);
PackRuleResult result = new PackRuleResult(bundleName, DefaultPackRule.AssetBundleFileExtension);
return result;
}
}
}

View File

@ -66,13 +66,13 @@ namespace YooAsset.Editor
_items.Add(new ItemWrapper("包裹名称", buildReport.Summary.BuildPackageName));
_items.Add(new ItemWrapper("包裹版本", buildReport.Summary.BuildPackageVersion));
_items.Add(new ItemWrapper(string.Empty, string.Empty));
_items.Add(new ItemWrapper("启用可寻址资源定位", $"{buildReport.Summary.EnableAddressable}"));
_items.Add(new ItemWrapper("资源定位地址大小写不敏感", $"{buildReport.Summary.LocationToLower}"));
_items.Add(new ItemWrapper("包含资源GUID数据", $"{buildReport.Summary.IncludeAssetGUID}"));
_items.Add(new ItemWrapper("资源包名唯一化", $"{buildReport.Summary.UniqueBundleName}"));
_items.Add(new ItemWrapper("自动分析冗余资源", $"{buildReport.Summary.AutoAnalyzeRedundancy}"));
_items.Add(new ItemWrapper("共享资源的打包类名称", buildReport.Summary.ShareAssetPackRuleClassName));
_items.Add(new ItemWrapper("加密服务类名称", buildReport.Summary.EncryptionServicesClassName));
_items.Add(new ItemWrapper("共享资源打包规则", buildReport.Summary.SharedPackRuleClassName));
_items.Add(new ItemWrapper("资源加密服务类", buildReport.Summary.EncryptionServicesClassName));
_items.Add(new ItemWrapper(string.Empty, string.Empty));
_items.Add(new ItemWrapper("构建参数", string.Empty));

View File

@ -169,7 +169,7 @@ namespace YooAsset
/// <summary>
/// 加载场景
/// </summary>
public SceneOperationHandle LoadSceneAsync(AssetInfo assetInfo, LoadSceneMode sceneMode, bool activateOnLoad, int priority)
public SceneOperationHandle LoadSceneAsync(AssetInfo assetInfo, LoadSceneMode sceneMode, int priority)
{
if (assetInfo.IsInvalid)
{
@ -190,9 +190,9 @@ namespace YooAsset
ProviderBase provider;
{
if (_simulationOnEditor)
provider = new DatabaseSceneProvider(this, providerGUID, assetInfo, sceneMode, activateOnLoad, priority);
provider = new DatabaseSceneProvider(this, providerGUID, assetInfo, sceneMode, priority);
else
provider = new BundledSceneProvider(this, providerGUID, assetInfo, sceneMode, activateOnLoad, priority);
provider = new BundledSceneProvider(this, providerGUID, assetInfo, sceneMode, priority);
provider.InitSpawnDebugInfo();
_providerList.Add(provider);
_providerDic.Add(providerGUID, provider);

View File

@ -51,7 +51,7 @@ namespace YooAsset
}
/// <summary>
/// 激活场景
/// 激活场景(当同时存在多个场景时用于切换激活场景)
/// </summary>
public bool ActivateScene()
{

View File

@ -4,17 +4,17 @@ using System.Collections.Generic;
namespace YooAsset
{
internal class DependAssetBundleGroup
internal class DependAssetBundles
{
/// <summary>
/// 依赖的资源包加载器列表
/// </summary>
internal readonly List<BundleLoaderBase> DependBundles;
internal readonly List<BundleLoaderBase> DependList;
public DependAssetBundleGroup(List<BundleLoaderBase> dpendBundles)
public DependAssetBundles(List<BundleLoaderBase> dpendList)
{
DependBundles = dpendBundles;
DependList = dpendList;
}
/// <summary>
@ -22,7 +22,7 @@ namespace YooAsset
/// </summary>
public bool IsDone()
{
foreach (var loader in DependBundles)
foreach (var loader in DependList)
{
if (loader.IsDone() == false)
return false;
@ -35,7 +35,7 @@ namespace YooAsset
/// </summary>
public bool IsSucceed()
{
foreach (var loader in DependBundles)
foreach (var loader in DependList)
{
if (loader.Status != BundleLoaderBase.EStatus.Succeed)
{
@ -50,7 +50,7 @@ namespace YooAsset
/// </summary>
public string GetLastError()
{
foreach (var loader in DependBundles)
foreach (var loader in DependList)
{
if (loader.Status != BundleLoaderBase.EStatus.Succeed)
{
@ -65,7 +65,7 @@ namespace YooAsset
/// </summary>
public void WaitForAsyncComplete()
{
foreach (var loader in DependBundles)
foreach (var loader in DependList)
{
if (loader.IsDone() == false)
loader.WaitForAsyncComplete();
@ -77,7 +77,7 @@ namespace YooAsset
/// </summary>
public void Reference()
{
foreach (var loader in DependBundles)
foreach (var loader in DependList)
{
loader.Reference();
}
@ -88,7 +88,7 @@ namespace YooAsset
/// </summary>
public void Release()
{
foreach (var loader in DependBundles)
foreach (var loader in DependList)
{
loader.Release();
}
@ -99,7 +99,7 @@ namespace YooAsset
/// </summary>
internal void GetBundleDebugInfos(List<DebugBundleInfo> output)
{
foreach (var loader in DependBundles)
foreach (var loader in DependList)
{
var bundleInfo = new DebugBundleInfo();
bundleInfo.BundleName = loader.MainBundleInfo.Bundle.BundleName;

View File

@ -28,19 +28,19 @@ namespace YooAsset
{
if (IsWaitForAsyncComplete)
{
DependBundleGroup.WaitForAsyncComplete();
DependBundles.WaitForAsyncComplete();
OwnerBundle.WaitForAsyncComplete();
}
if (DependBundleGroup.IsDone() == false)
if (DependBundles.IsDone() == false)
return;
if (OwnerBundle.IsDone() == false)
return;
if (DependBundleGroup.IsSucceed() == false)
if (DependBundles.IsSucceed() == false)
{
Status = EStatus.Failed;
LastError = DependBundleGroup.GetLastError();
LastError = DependBundles.GetLastError();
InvokeCompletion();
return;
}

View File

@ -28,19 +28,19 @@ namespace YooAsset
{
if (IsWaitForAsyncComplete)
{
DependBundleGroup.WaitForAsyncComplete();
DependBundles.WaitForAsyncComplete();
OwnerBundle.WaitForAsyncComplete();
}
if (DependBundleGroup.IsDone() == false)
if (DependBundles.IsDone() == false)
return;
if (OwnerBundle.IsDone() == false)
return;
if (DependBundleGroup.IsSucceed() == false)
if (DependBundles.IsSucceed() == false)
{
Status = EStatus.Failed;
LastError = DependBundleGroup.GetLastError();
LastError = DependBundles.GetLastError();
InvokeCompletion();
return;
}

View File

@ -10,15 +10,13 @@ namespace YooAsset
{
public readonly LoadSceneMode SceneMode;
private readonly string _sceneName;
private readonly bool _activateOnLoad;
private readonly int _priority;
private AsyncOperation _asyncOp;
public BundledSceneProvider(AssetSystemImpl impl, string providerGUID, AssetInfo assetInfo, LoadSceneMode sceneMode, bool activateOnLoad, int priority) : base(impl, providerGUID, assetInfo)
public BundledSceneProvider(AssetSystemImpl impl, string providerGUID, AssetInfo assetInfo, LoadSceneMode sceneMode, int priority) : base(impl, providerGUID, assetInfo)
{
SceneMode = sceneMode;
_sceneName = Path.GetFileNameWithoutExtension(assetInfo.AssetPath);
_activateOnLoad = activateOnLoad;
_priority = priority;
}
public override void Update()
@ -36,15 +34,15 @@ namespace YooAsset
// 1. 检测资源包
if (Status == EStatus.CheckBundle)
{
if (DependBundleGroup.IsDone() == false)
if (DependBundles.IsDone() == false)
return;
if (OwnerBundle.IsDone() == false)
return;
if (DependBundleGroup.IsSucceed() == false)
if (DependBundles.IsSucceed() == false)
{
Status = EStatus.Failed;
LastError = DependBundleGroup.GetLastError();
LastError = DependBundles.GetLastError();
InvokeCompletion();
return;
}
@ -87,9 +85,6 @@ namespace YooAsset
Progress = _asyncOp.progress;
if (_asyncOp.isDone)
{
if (SceneObject.IsValid() && _activateOnLoad)
SceneManager.SetActiveScene(SceneObject);
Status = SceneObject.IsValid() ? EStatus.Succeed : EStatus.Failed;
if (Status == EStatus.Failed)
{

View File

@ -28,19 +28,19 @@ namespace YooAsset
{
if (IsWaitForAsyncComplete)
{
DependBundleGroup.WaitForAsyncComplete();
DependBundles.WaitForAsyncComplete();
OwnerBundle.WaitForAsyncComplete();
}
if (DependBundleGroup.IsDone() == false)
if (DependBundles.IsDone() == false)
return;
if (OwnerBundle.IsDone() == false)
return;
if (DependBundleGroup.IsSucceed() == false)
if (DependBundles.IsSucceed() == false)
{
Status = EStatus.Failed;
LastError = DependBundleGroup.GetLastError();
LastError = DependBundles.GetLastError();
InvokeCompletion();
return;
}

View File

@ -6,14 +6,12 @@ namespace YooAsset
internal sealed class DatabaseSceneProvider : ProviderBase
{
public readonly LoadSceneMode SceneMode;
private readonly bool _activateOnLoad;
private readonly int _priority;
private AsyncOperation _asyncOp;
public DatabaseSceneProvider(AssetSystemImpl impl, string providerGUID, AssetInfo assetInfo, LoadSceneMode sceneMode, bool activateOnLoad, int priority) : base(impl, providerGUID, assetInfo)
public DatabaseSceneProvider(AssetSystemImpl impl, string providerGUID, AssetInfo assetInfo, LoadSceneMode sceneMode, int priority) : base(impl, providerGUID, assetInfo)
{
SceneMode = sceneMode;
_activateOnLoad = activateOnLoad;
_priority = priority;
}
public override void Update()
@ -77,9 +75,6 @@ namespace YooAsset
Progress = _asyncOp.progress;
if (_asyncOp.isDone)
{
if (SceneObject.IsValid() && _activateOnLoad)
SceneManager.SetActiveScene(SceneObject);
Status = SceneObject.IsValid() ? EStatus.Succeed : EStatus.Failed;
if (Status == EStatus.Failed)
{

View File

@ -91,7 +91,7 @@ namespace YooAsset
protected BundleLoaderBase OwnerBundle { private set; get; }
protected DependAssetBundleGroup DependBundleGroup { private set; get; }
protected DependAssetBundles DependBundles { private set; get; }
protected bool IsWaitForAsyncComplete { private set; get; } = false;
private readonly List<OperationHandleBase> _handles = new List<OperationHandleBase>();
@ -109,9 +109,9 @@ namespace YooAsset
OwnerBundle.Reference();
OwnerBundle.AddProvider(this);
var dependBundles = impl.CreateDependAssetBundleLoaders(assetInfo);
DependBundleGroup = new DependAssetBundleGroup(dependBundles);
DependBundleGroup.Reference();
var dependList = impl.CreateDependAssetBundleLoaders(assetInfo);
DependBundles = new DependAssetBundles(dependList);
DependBundles.Reference();
}
}
@ -133,10 +133,10 @@ namespace YooAsset
OwnerBundle.Release();
OwnerBundle = null;
}
if (DependBundleGroup != null)
if (DependBundles != null)
{
DependBundleGroup.Release();
DependBundleGroup = null;
DependBundles.Release();
DependBundles = null;
}
}
@ -322,7 +322,7 @@ namespace YooAsset
DownloadReport result = new DownloadReport();
result.TotalSize = (ulong)OwnerBundle.MainBundleInfo.Bundle.FileSize;
result.DownloadedBytes = OwnerBundle.DownloadedBytes;
foreach (var dependBundle in DependBundleGroup.DependBundles)
foreach (var dependBundle in DependBundles.DependList)
{
result.TotalSize += (ulong)dependBundle.MainBundleInfo.Bundle.FileSize;
result.DownloadedBytes += dependBundle.DownloadedBytes;
@ -342,7 +342,7 @@ namespace YooAsset
bundleInfo.Status = OwnerBundle.Status.ToString();
output.Add(bundleInfo);
DependBundleGroup.GetBundleDebugInfos(output);
DependBundles.GetBundleDebugInfos(output);
}
#endregion
}

View File

@ -455,13 +455,12 @@ namespace YooAsset
/// </summary>
/// <param name="location">场景的定位地址</param>
/// <param name="sceneMode">场景加载模式</param>
/// <param name="activateOnLoad">加载完毕时是否主动激活</param>
/// <param name="priority">优先级</param>
public SceneOperationHandle LoadSceneAsync(string location, LoadSceneMode sceneMode = LoadSceneMode.Single, bool activateOnLoad = true, int priority = 100)
public SceneOperationHandle LoadSceneAsync(string location, LoadSceneMode sceneMode = LoadSceneMode.Single, int priority = 100)
{
DebugCheckInitialize();
AssetInfo assetInfo = ConvertLocationToAssetInfo(location, null);
var handle = _assetSystemImpl.LoadSceneAsync(assetInfo, sceneMode, activateOnLoad, priority);
var handle = _assetSystemImpl.LoadSceneAsync(assetInfo, sceneMode, priority);
return handle;
}
@ -470,12 +469,11 @@ namespace YooAsset
/// </summary>
/// <param name="assetInfo">场景的资源信息</param>
/// <param name="sceneMode">场景加载模式</param>
/// <param name="activateOnLoad">加载完毕时是否主动激活</param>
/// <param name="priority">优先级</param>
public SceneOperationHandle LoadSceneAsync(AssetInfo assetInfo, LoadSceneMode sceneMode = LoadSceneMode.Single, bool activateOnLoad = true, int priority = 100)
public SceneOperationHandle LoadSceneAsync(AssetInfo assetInfo, LoadSceneMode sceneMode = LoadSceneMode.Single, int priority = 100)
{
DebugCheckInitialize();
var handle = _assetSystemImpl.LoadSceneAsync(assetInfo, sceneMode, activateOnLoad, priority);
var handle = _assetSystemImpl.LoadSceneAsync(assetInfo, sceneMode, priority);
return handle;
}
#endregion

View File

@ -128,12 +128,11 @@ namespace YooAsset
/// </summary>
/// <param name="location">场景的定位地址</param>
/// <param name="sceneMode">场景加载模式</param>
/// <param name="activateOnLoad">加载完毕时是否主动激活</param>
/// <param name="priority">优先级</param>
public static SceneOperationHandle LoadSceneAsync(string location, LoadSceneMode sceneMode = LoadSceneMode.Single, bool activateOnLoad = true, int priority = 100)
public static SceneOperationHandle LoadSceneAsync(string location, LoadSceneMode sceneMode = LoadSceneMode.Single, int priority = 100)
{
DebugCheckDefaultPackageValid();
return _defaultPackage.LoadSceneAsync(location, sceneMode, activateOnLoad, priority);
return _defaultPackage.LoadSceneAsync(location, sceneMode, priority);
}
/// <summary>
@ -141,12 +140,11 @@ namespace YooAsset
/// </summary>
/// <param name="assetInfo">场景的资源信息</param>
/// <param name="sceneMode">场景加载模式</param>
/// <param name="activateOnLoad">加载完毕时是否主动激活</param>
/// <param name="priority">优先级</param>
public static SceneOperationHandle LoadSceneAsync(AssetInfo assetInfo, LoadSceneMode sceneMode = LoadSceneMode.Single, bool activateOnLoad = true, int priority = 100)
public static SceneOperationHandle LoadSceneAsync(AssetInfo assetInfo, LoadSceneMode sceneMode = LoadSceneMode.Single, int priority = 100)
{
DebugCheckDefaultPackageValid();
return _defaultPackage.LoadSceneAsync(assetInfo, sceneMode, activateOnLoad, priority);
return _defaultPackage.LoadSceneAsync(assetInfo, sceneMode, priority);
}
#endregion