Compare commits

...

5 Commits

Author SHA1 Message Date
何冠峰
bfd476d59c Update DownloadCenterOperation.cs 2025-07-21 18:22:51 +08:00
何冠峰
7dd08e9634 update test sample 2025-07-21 18:05:08 +08:00
何冠峰
b2776b933a update mini game sample 2025-07-21 15:52:51 +08:00
何冠峰
9f09b6c526 update file system 2025-07-21 15:52:07 +08:00
何冠峰
01f6103b48 Update AssemblyInfo.cs 2025-07-21 15:48:52 +08:00
65 changed files with 596 additions and 939 deletions

View File

@@ -2,6 +2,7 @@
// 内部友元
[assembly: InternalsVisibleTo("YooAsset.Editor")]
[assembly: InternalsVisibleTo("YooAsset.Test")]
[assembly: InternalsVisibleTo("YooAsset.Test.Editor")]
// 外部友元

View File

@@ -17,7 +17,7 @@ namespace YooAsset
private readonly DefaultBuildinFileSystem _fileSystem;
private CopyBuildinPackageManifestOperation _copyBuildinPackageManifestOp;
private FSInitializeFileSystemOperation _initUnpackFIleSystemOp;
private LoadBuildinCatalogFileOperation _loadCatalogFileOp;
private LoadBuildinCatalogFileOperation _loadBuildinCatalogFileOp;
private ESteps _steps = ESteps.None;
internal DBFSInitializeOperation(DefaultBuildinFileSystem fileSystem)
@@ -103,34 +103,18 @@ namespace YooAsset
if (_steps == ESteps.LoadCatalogFile)
{
if (_loadCatalogFileOp == null)
if (_loadBuildinCatalogFileOp == null)
{
#if UNITY_EDITOR
/*
// 兼容性初始化
// 说明:内置文件系统在编辑器下运行时需要动态生成
string packageRoot = _fileSystem.FileRoot;
bool result = DefaultBuildinFileSystemBuild.CreateBuildinCatalogFile(_fileSystem.ManifestServices, _fileSystem.PackageName, packageRoot);
if (result == false)
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = $"Create package catalog file failed ! See the detail error in console !";
return;
}
*/
#endif
_loadCatalogFileOp = new LoadBuildinCatalogFileOperation(_fileSystem);
_loadCatalogFileOp.StartOperation();
AddChildOperation(_loadCatalogFileOp);
_loadBuildinCatalogFileOp = new LoadBuildinCatalogFileOperation(_fileSystem);
_loadBuildinCatalogFileOp.StartOperation();
AddChildOperation(_loadBuildinCatalogFileOp);
}
_loadCatalogFileOp.UpdateOperation();
if (_loadCatalogFileOp.IsDone == false)
_loadBuildinCatalogFileOp.UpdateOperation();
if (_loadBuildinCatalogFileOp.IsDone == false)
return;
if (_loadCatalogFileOp.Status == EOperationStatus.Succeed)
if (_loadBuildinCatalogFileOp.Status == EOperationStatus.Succeed)
{
_steps = ESteps.Done;
Status = EOperationStatus.Succeed;
@@ -139,7 +123,7 @@ namespace YooAsset
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = _loadCatalogFileOp.Error;
Error = _loadBuildinCatalogFileOp.Error;
}
}
}

View File

@@ -104,27 +104,28 @@ namespace YooAsset
}
}
if (_assetBundle != null)
if (_assetBundle == null)
{
_steps = ESteps.Done;
Result = new AssetBundleResult(_fileSystem, _bundle, _assetBundle, _managedStream);
Status = EOperationStatus.Succeed;
return;
}
if (_bundle.Encrypted)
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = $"Failed to load encrypted buildin asset bundle file : {_bundle.BundleName}";
YooLogger.Error(Error);
if (_bundle.Encrypted)
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = $"Failed to load encrypted buildin asset bundle file : {_bundle.BundleName}";
YooLogger.Error(Error);
}
else
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = $"Failed to load buildin asset bundle file : {_bundle.BundleName}";
YooLogger.Error(Error);
}
}
else
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = $"Failed to load buildin asset bundle file : {_bundle.BundleName}";
YooLogger.Error(Error);
Result = new AssetBundleResult(_fileSystem, _bundle, _assetBundle, _managedStream);
Status = EOperationStatus.Succeed;
}
}
}
@@ -176,13 +177,15 @@ namespace YooAsset
if (_steps == ESteps.LoadBuildinRawBundle)
{
string filePath = _fileSystem.GetBuildinFileLoadPath(_bundle);
#if UNITY_ANDROID
//TODO : 安卓平台内置文件属于APK压缩包内的文件。
_steps = ESteps.Done;
Result = new RawBundleResult(_fileSystem, _bundle);
Status = EOperationStatus.Succeed;
Status = EOperationStatus.Failed;
Error = $"Can not load android buildin raw bundle file : {filePath}";
YooLogger.Error(Error);
#else
string filePath = _fileSystem.GetBuildinFileLoadPath(_bundle);
if (File.Exists(filePath))
{
_steps = ESteps.Done;

View File

@@ -20,8 +20,8 @@ namespace YooAsset
private readonly DefaultBuildinFileSystem _fileSystem;
private RequestBuildinPackageVersionOperation _requestBuildinPackageVersionOp;
private UnityWebFileRequestOperation _hashFileRequestOp;
private UnityWebFileRequestOperation _manifestFileRequestOp;
private UnityWebFileRequestOperation _hashWebFileRequestOp;
private UnityWebFileRequestOperation _manifestWebFileRequestOp;
private string _buildinPackageVersion;
private ESteps _steps = ESteps.None;
@@ -78,21 +78,21 @@ namespace YooAsset
if (_steps == ESteps.UnpackHashFile)
{
if (_hashFileRequestOp == null)
if (_hashWebFileRequestOp == null)
{
string sourcePath = _fileSystem.GetBuildinPackageHashFilePath(_buildinPackageVersion);
string destPath = GetCopyPackageHashDestPath(_buildinPackageVersion);
string url = DownloadSystemHelper.ConvertToWWWPath(sourcePath);
_hashFileRequestOp = new UnityWebFileRequestOperation(url, destPath, 60);
_hashFileRequestOp.StartOperation();
AddChildOperation(_hashFileRequestOp);
_hashWebFileRequestOp = new UnityWebFileRequestOperation(url, destPath, 60);
_hashWebFileRequestOp.StartOperation();
AddChildOperation(_hashWebFileRequestOp);
}
_hashFileRequestOp.UpdateOperation();
if (_hashFileRequestOp.IsDone == false)
_hashWebFileRequestOp.UpdateOperation();
if (_hashWebFileRequestOp.IsDone == false)
return;
if (_hashFileRequestOp.Status == EOperationStatus.Succeed)
if (_hashWebFileRequestOp.Status == EOperationStatus.Succeed)
{
_steps = ESteps.CheckManifestFile;
}
@@ -100,7 +100,7 @@ namespace YooAsset
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = _hashFileRequestOp.Error;
Error = _hashWebFileRequestOp.Error;
}
}
@@ -119,21 +119,21 @@ namespace YooAsset
if (_steps == ESteps.UnpackManifestFile)
{
if (_manifestFileRequestOp == null)
if (_manifestWebFileRequestOp == null)
{
string sourcePath = _fileSystem.GetBuildinPackageManifestFilePath(_buildinPackageVersion);
string destPath = GetCopyPackageManifestDestPath(_buildinPackageVersion);
string url = DownloadSystemHelper.ConvertToWWWPath(sourcePath);
_manifestFileRequestOp = new UnityWebFileRequestOperation(url, destPath, 60);
_manifestFileRequestOp.StartOperation();
AddChildOperation(_manifestFileRequestOp);
_manifestWebFileRequestOp = new UnityWebFileRequestOperation(url, destPath, 60);
_manifestWebFileRequestOp.StartOperation();
AddChildOperation(_manifestWebFileRequestOp);
}
_manifestFileRequestOp.UpdateOperation();
if (_manifestFileRequestOp.IsDone == false)
_manifestWebFileRequestOp.UpdateOperation();
if (_manifestWebFileRequestOp.IsDone == false)
return;
if (_manifestFileRequestOp.Status == EOperationStatus.Succeed)
if (_manifestWebFileRequestOp.Status == EOperationStatus.Succeed)
{
_steps = ESteps.Done;
Status = EOperationStatus.Succeed;
@@ -142,7 +142,7 @@ namespace YooAsset
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = _manifestFileRequestOp.Error;
Error = _manifestWebFileRequestOp.Error;
}
}
}

View File

@@ -3,22 +3,11 @@ using System.Collections.Generic;
namespace YooAsset
{
/// <summary>
/// 下载器单元测试
/// 1. 下载失败重试机制
/// 2. 下载引用计数机制
/// 3. 最大下载并发机制
/// 4. 异步下载远端资源
/// 5. 同步下载远端资源
/// 6. 异步拷贝本地资源
/// 7. 同步拷贝本地资源
/// 9. 断点续传下载器
/// </summary>
internal class DownloadCenterOperation : AsyncOperationBase
{
private readonly DefaultCacheFileSystem _fileSystem;
protected readonly Dictionary<string, UnityDownloadFileOperation> _downloaders = new Dictionary<string, UnityDownloadFileOperation>(1000);
protected readonly List<string> _removeDownloadList = new List<string>(1000);
protected readonly List<string> _removeList = new List<string>(1000);
public DownloadCenterOperation(DefaultCacheFileSystem fileSystem)
{
@@ -30,29 +19,28 @@ namespace YooAsset
internal override void InternalUpdate()
{
// 获取可移除的下载器集合
_removeDownloadList.Clear();
_removeList.Clear();
foreach (var valuePair in _downloaders)
{
var downloader = valuePair.Value;
downloader.UpdateOperation();
if (downloader.IsDone)
{
_removeList.Add(valuePair.Key);
continue;
}
// 注意:主动终止引用计数为零的下载任务
if (downloader.RefCount <= 0)
{
_removeDownloadList.Add(valuePair.Key);
_removeList.Add(valuePair.Key);
downloader.AbortOperation();
continue;
}
if (downloader.IsDone)
{
_removeDownloadList.Add(valuePair.Key);
continue;
}
}
// 移除下载器
foreach (var key in _removeDownloadList)
foreach (var key in _removeList)
{
_downloaders.Remove(key);
}

View File

@@ -67,7 +67,7 @@ namespace YooAsset
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = $"{nameof(LoadWebAssetBundleOperation)} loaded asset bundle is null !";
Error = $"{nameof(DWRFSLoadAssetBundleOperation)} loaded asset bundle is null !";
}
else
{

View File

@@ -32,22 +32,6 @@ namespace YooAsset
{
if (_loadCatalogFileOp == null)
{
#if UNITY_EDITOR
/*
// 兼容性初始化
// 说明:内置文件系统在编辑器下运行时需要动态生成
string packageRoot = _fileSystem.FileRoot;
bool result = DefaultBuildinFileSystemBuild.CreateBuildinCatalogFile(_fileSystem.ManifestServices, _fileSystem.PackageName, packageRoot);
if (result == false)
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = $"Create package catalog file failed ! See the detail error in console !";
return;
}
*/
#endif
_loadCatalogFileOp = new LoadWebServerCatalogFileOperation(_fileSystem, 60);
_loadCatalogFileOp.StartOperation();
AddChildOperation(_loadCatalogFileOp);

View File

@@ -67,7 +67,7 @@ namespace YooAsset
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = $"{nameof(LoadWebAssetBundleOperation)} loaded asset bundle is null !";
Error = $"{nameof(DWSFSLoadAssetBundleOperation)} loaded asset bundle is null !";
}
else
{

View File

@@ -1,7 +1,4 @@
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
namespace YooAsset
{

View File

@@ -13,10 +13,10 @@ namespace YooAsset
Done,
}
private UnityWebDataRequestOperation _unityWebDataRequestOp;
private readonly PackageBundle _bundle;
private readonly DownloadFileOptions _options;
private readonly IWebDecryptionServices _decryptionServices;
private UnityWebDataRequestOperation _unityWebDataRequestOp;
protected int _requestCount = 0;
protected float _tryAgainTimer;
@@ -53,6 +53,7 @@ namespace YooAsset
string url = GetRequestURL();
_unityWebDataRequestOp = new UnityWebDataRequestOperation(url, 0);
_unityWebDataRequestOp.StartOperation();
AddChildOperation(_unityWebDataRequestOp);
_steps = ESteps.CheckRequest;
}
@@ -115,12 +116,6 @@ namespace YooAsset
}
}
}
internal override void InternalAbort()
{
_steps = ESteps.Done;
if (_unityWebDataRequestOp != null)
_unityWebDataRequestOp.AbortOperation();
}
/// <summary>
/// 加载加密资源文件

View File

@@ -45,6 +45,7 @@ namespace YooAsset
string url = GetRequestURL();
_unityAssetBundleRequestOp = new UnityAssetBundleRequestOperation(_bundle, _disableUnityWebCache, url);
_unityAssetBundleRequestOp.StartOperation();
AddChildOperation(_unityAssetBundleRequestOp);
_steps = ESteps.CheckRequest;
}
@@ -96,12 +97,6 @@ namespace YooAsset
}
}
}
internal override void InternalAbort()
{
_steps = ESteps.Done;
if (_unityAssetBundleRequestOp != null)
_unityAssetBundleRequestOp.AbortOperation();
}
/// <summary>
/// 获取网络请求地址

View File

@@ -15,7 +15,7 @@ internal class TTFSDownloadFileOperation : FSDownloadFileOperation
private readonly TiktokFileSystem _fileSystem;
private readonly DownloadFileOptions _options;
private UnityWebCacheRequestOperation _unityWebCacheRequestOp;
private UnityWebCacheRequestOperation _webCacheRequestOp;
private int _requestCount = 0;
private float _tryAgainTimer;
private int _failedTryAgain;
@@ -36,21 +36,23 @@ internal class TTFSDownloadFileOperation : FSDownloadFileOperation
if (_steps == ESteps.CreateRequest)
{
string url = GetRequestURL();
_unityWebCacheRequestOp = new UnityWebCacheRequestOperation(url);
_unityWebCacheRequestOp.StartOperation();
_webCacheRequestOp = new UnityWebCacheRequestOperation(url);
_webCacheRequestOp.StartOperation();
AddChildOperation(_webCacheRequestOp);
_steps = ESteps.CheckRequest;
}
// 检测下载结果
if (_steps == ESteps.CheckRequest)
{
Progress = _unityWebCacheRequestOp.Progress;
DownloadProgress = _unityWebCacheRequestOp.DownloadProgress;
DownloadedBytes = (long)_unityWebCacheRequestOp.DownloadedBytes;
if (_unityWebCacheRequestOp.IsDone == false)
_webCacheRequestOp.UpdateOperation();
Progress = _webCacheRequestOp.Progress;
DownloadProgress = _webCacheRequestOp.DownloadProgress;
DownloadedBytes = (long)_webCacheRequestOp.DownloadedBytes;
if (_webCacheRequestOp.IsDone == false)
return;
if (_unityWebCacheRequestOp.Status == EOperationStatus.Succeed)
if (_webCacheRequestOp.Status == EOperationStatus.Succeed)
{
_steps = ESteps.Done;
Status = EOperationStatus.Succeed;
@@ -65,13 +67,13 @@ internal class TTFSDownloadFileOperation : FSDownloadFileOperation
if (_failedTryAgain > 0)
{
_steps = ESteps.TryAgain;
YooLogger.Warning($"Failed download : {_unityWebCacheRequestOp.URL} Try again !");
YooLogger.Warning($"Failed download : {_webCacheRequestOp.URL} Try again !");
}
else
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = _unityWebCacheRequestOp.Error;
Error = _webCacheRequestOp.Error;
YooLogger.Error(Error);
}
}

View File

@@ -54,9 +54,9 @@ internal class TTFSLoadBundleOperation : FSLoadBundleOperation
}
_loadWebAssetBundleOp.UpdateOperation();
Progress = _loadWebAssetBundleOp.Progress;
DownloadProgress = _loadWebAssetBundleOp.DownloadProgress;
DownloadedBytes = (long)_loadWebAssetBundleOp.DownloadedBytes;
Progress = DownloadProgress;
if (_loadWebAssetBundleOp.IsDone == false)
return;

View File

@@ -15,7 +15,7 @@ internal class WXFSDownloadFileOperation : FSDownloadFileOperation
private readonly WechatFileSystem _fileSystem;
private readonly DownloadFileOptions _options;
private UnityWebCacheRequestOperation _unityWebCacheRequestOp;
private UnityWebCacheRequestOperation _webCacheRequestOp;
private int _requestCount = 0;
private float _tryAgainTimer;
private int _failedTryAgain;
@@ -36,24 +36,24 @@ internal class WXFSDownloadFileOperation : FSDownloadFileOperation
if (_steps == ESteps.CreateRequest)
{
string url = GetRequestURL();
_unityWebCacheRequestOp = new UnityWebCacheRequestOperation(url);
_unityWebCacheRequestOp.SetRequestHeader("wechatminigame-preload", "1");
_unityWebCacheRequestOp.StartOperation();
AddChildOperation(_unityWebCacheRequestOp);
_webCacheRequestOp = new UnityWebCacheRequestOperation(url);
_webCacheRequestOp.SetRequestHeader("wechatminigame-preload", "1");
_webCacheRequestOp.StartOperation();
AddChildOperation(_webCacheRequestOp);
_steps = ESteps.CheckRequest;
}
// 检测下载结果
if (_steps == ESteps.CheckRequest)
{
_unityWebCacheRequestOp.UpdateOperation();
Progress = _unityWebCacheRequestOp.Progress;
DownloadProgress = _unityWebCacheRequestOp.DownloadProgress;
DownloadedBytes = (long)_unityWebCacheRequestOp.DownloadedBytes;
if (_unityWebCacheRequestOp.IsDone == false)
_webCacheRequestOp.UpdateOperation();
Progress = _webCacheRequestOp.Progress;
DownloadProgress = _webCacheRequestOp.DownloadProgress;
DownloadedBytes = (long)_webCacheRequestOp.DownloadedBytes;
if (_webCacheRequestOp.IsDone == false)
return;
if (_unityWebCacheRequestOp.Status == EOperationStatus.Succeed)
if (_webCacheRequestOp.Status == EOperationStatus.Succeed)
{
_steps = ESteps.Done;
Status = EOperationStatus.Succeed;
@@ -69,13 +69,13 @@ internal class WXFSDownloadFileOperation : FSDownloadFileOperation
if (_failedTryAgain > 0)
{
_steps = ESteps.TryAgain;
YooLogger.Warning($"Failed download : {_unityWebCacheRequestOp.URL} Try again !");
YooLogger.Warning($"Failed download : {_webCacheRequestOp.URL} Try again !");
}
else
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = _unityWebCacheRequestOp.Error;
Error = _webCacheRequestOp.Error;
YooLogger.Error(Error);
}
}

View File

@@ -53,9 +53,9 @@ internal class WXFSLoadBundleOperation : FSLoadBundleOperation
}
_loadWebAssetBundleOp.UpdateOperation();
Progress = _loadWebAssetBundleOp.Progress;
DownloadProgress = _loadWebAssetBundleOp.DownloadProgress;
DownloadedBytes = (long)_loadWebAssetBundleOp.DownloadedBytes;
Progress = DownloadProgress;
if (_loadWebAssetBundleOp.IsDone == false)
return;

View File

@@ -96,12 +96,6 @@ namespace YooAsset
}
}
}
internal override void InternalAbort()
{
_steps = ESteps.Done;
if (_unityWechatAssetBundleRequestOp != null)
_unityWechatAssetBundleRequestOp.AbortOperation();
}
/// <summary>
/// 获取网络请求地址

View File

@@ -89,7 +89,7 @@ public class T0_InitYooAssets : IPrebuildSetup, IPostBuildCleanup
YooAsset.Editor.AssetBundleCollectorSettingData.CreateCollector(panelGroup, collector1);
}
// 预制体构建到一个AB
// 预制体
var prefabGroup = YooAsset.Editor.AssetBundleCollectorSettingData.CreateGroup(testPackage, "PrefabGroup");
{
var collector1 = new YooAsset.Editor.AssetBundleCollector();
@@ -166,15 +166,16 @@ public class T0_InitYooAssets : IPrebuildSetup, IPostBuildCleanup
{
var collector1 = new YooAsset.Editor.AssetBundleCollector();
collector1.CollectPath = "";
collector1.CollectorGUID = "e082d492b9da65e499cee3495be3645d"; //TestRes3/music目录
collector1.CollectorGUID = "e082d492b9da65e499cee3495be3645d"; //TestRes3/encrypt目录
collector1.CollectorType = YooAsset.Editor.ECollectorType.MainAssetCollector;
collector1.PackRuleName = nameof(YooAsset.Editor.PackSeparately);
YooAsset.Editor.AssetBundleCollectorSettingData.CreateCollector(encryptGroup, collector1);
var collector2 = new YooAsset.Editor.AssetBundleCollector();
collector2.CollectPath = "";
collector2.CollectorGUID = "8c5a1726d94498e4cbe30f5f510cc796"; //TestRes3/prefab目录
collector2.CollectorGUID = "35f454fb80a715047bcf0ce30c7c4f18"; //TestRes3/import目录
collector2.CollectorType = YooAsset.Editor.ECollectorType.MainAssetCollector;
collector2.AssetTags = "import";
collector2.PackRuleName = nameof(YooAsset.Editor.PackSeparately);
YooAsset.Editor.AssetBundleCollectorSettingData.CreateCollector(encryptGroup, collector2);
@@ -185,14 +186,6 @@ public class T0_InitYooAssets : IPrebuildSetup, IPostBuildCleanup
collector3.AssetTags = "unpack";
collector3.PackRuleName = nameof(YooAsset.Editor.PackSeparately);
YooAsset.Editor.AssetBundleCollectorSettingData.CreateCollector(encryptGroup, collector3);
var collector4 = new YooAsset.Editor.AssetBundleCollector();
collector4.CollectPath = "";
collector4.CollectorGUID = "35f454fb80a715047bcf0ce30c7c4f18"; //TestRes3/import目录
collector4.CollectorType = YooAsset.Editor.ECollectorType.MainAssetCollector;
collector4.AssetTags = "import";
collector4.PackRuleName = nameof(YooAsset.Editor.PackSeparately);
YooAsset.Editor.AssetBundleCollectorSettingData.CreateCollector(encryptGroup, collector4);
}
}
private static void CreateRawBundlePackageCollector()

View File

@@ -47,7 +47,7 @@ public class T1_TestEditorFileSystem : IPrebuildSetup, IPostBuildCleanup
[UnityTest]
public IEnumerator A_InitializePackage()
{
// 初始化资源包
// 初始化资源包 ASSET_BUNDLE
{
string packageRoot = string.Empty;
#if UNITY_EDITOR
@@ -82,7 +82,7 @@ public class T1_TestEditorFileSystem : IPrebuildSetup, IPostBuildCleanup
Assert.AreEqual(EOperationStatus.Succeed, updateManifestOp.Status);
}
// 初始化资源包
// 初始化资源包 RAW_BUNDLE
{
string packageRoot = string.Empty;
#if UNITY_EDITOR
@@ -119,30 +119,30 @@ public class T1_TestEditorFileSystem : IPrebuildSetup, IPostBuildCleanup
}
[UnityTest]
public IEnumerator B1_TestLoadAsyncTask()
public IEnumerator B1_TestAsyncTask()
{
var tester = new TestLoadPanel();
var tester = new TestAsyncTask();
yield return tester.RuntimeTester();
}
[UnityTest]
public IEnumerator B2_TestLoadAudio()
public IEnumerator B2_TestLoadAsset()
{
var tester = new TestLoadAudio();
var tester = new TestLoadAsset();
yield return tester.RuntimeTester();
}
[UnityTest]
public IEnumerator B3_TestLoadImage()
public IEnumerator B3_TestLoadSubAssets()
{
var tester = new TestLoadImage();
var tester = new TestLoadSubAssets();
yield return tester.RuntimeTester();
}
[UnityTest]
public IEnumerator B4_TestLoadPrefab()
public IEnumerator B4_TestLoadAllAssets()
{
var tester = new TestLoadPrefab();
var tester = new TestLoadAllAssets();
yield return tester.RuntimeTester();
}
@@ -182,32 +182,9 @@ public class T1_TestEditorFileSystem : IPrebuildSetup, IPostBuildCleanup
}
[UnityTest]
public IEnumerator C_DestroyPackage()
public IEnumerator D_DestroyPackage()
{
// 销毁旧资源包
{
var package = YooAssets.GetPackage(TestDefine.AssetBundlePackageName);
var destroyOp = package.DestroyAsync();
yield return destroyOp;
if (destroyOp.Status != EOperationStatus.Succeed)
Debug.LogError(destroyOp.Error);
Assert.AreEqual(EOperationStatus.Succeed, destroyOp.Status);
bool result = YooAssets.RemovePackage(TestDefine.AssetBundlePackageName);
Assert.IsTrue(result);
}
// 销毁旧资源包
{
var package = YooAssets.GetPackage(TestDefine.RawBundlePackageName);
var destroyOp = package.DestroyAsync();
yield return destroyOp;
if (destroyOp.Status != EOperationStatus.Succeed)
Debug.LogError(destroyOp.Error);
Assert.AreEqual(EOperationStatus.Succeed, destroyOp.Status);
bool result = YooAssets.RemovePackage(TestDefine.RawBundlePackageName);
Assert.IsTrue(result);
}
var tester = new TestDestroyPackage();
yield return tester.RuntimeTester(true);
}
}

View File

@@ -125,30 +125,30 @@ public class T2_TestBuldinFileSystem : IPrebuildSetup, IPostBuildCleanup
}
[UnityTest]
public IEnumerator B1_TestLoadAsyncTask()
public IEnumerator B1_TestAsyncTask()
{
var tester = new TestLoadPanel();
var tester = new TestAsyncTask();
yield return tester.RuntimeTester();
}
[UnityTest]
public IEnumerator B2_TestLoadAudio()
public IEnumerator B2_TestLoadAsset()
{
var tester = new TestLoadAudio();
var tester = new TestLoadAsset();
yield return tester.RuntimeTester();
}
[UnityTest]
public IEnumerator B3_TestLoadImage()
public IEnumerator B3_TestLoadSubAssets()
{
var tester = new TestLoadImage();
var tester = new TestLoadSubAssets();
yield return tester.RuntimeTester();
}
[UnityTest]
public IEnumerator B4_TestLoadPrefab()
public IEnumerator B4_TestLoadAllAssets()
{
var tester = new TestLoadPrefab();
var tester = new TestLoadAllAssets();
yield return tester.RuntimeTester();
}
@@ -186,7 +186,7 @@ public class T2_TestBuldinFileSystem : IPrebuildSetup, IPostBuildCleanup
var tester = new TestLoadVideo();
yield return tester.RuntimeTester();
}
[UnityTest]
public IEnumerator C1_TestBundleReference()
{
@@ -201,33 +201,17 @@ public class T2_TestBuldinFileSystem : IPrebuildSetup, IPostBuildCleanup
yield return tester.RuntimeTester();
}
[UnityTest]
public IEnumerator C3_TestBundleUnpacker()
{
var tester = new TestBundleUnpacker();
yield return tester.RuntimeTester();
}
[UnityTest]
public IEnumerator D_DestroyPackage()
{
// 销毁旧资源包
{
var package = YooAssets.GetPackage(TestDefine.AssetBundlePackageName);
var destroyOp = package.DestroyAsync();
yield return destroyOp;
if (destroyOp.Status != EOperationStatus.Succeed)
Debug.LogError(destroyOp.Error);
Assert.AreEqual(EOperationStatus.Succeed, destroyOp.Status);
bool result = YooAssets.RemovePackage(TestDefine.AssetBundlePackageName);
Assert.IsTrue(result);
}
// 销毁旧资源包
{
var package = YooAssets.GetPackage(TestDefine.RawBundlePackageName);
var destroyOp = package.DestroyAsync();
yield return destroyOp;
if (destroyOp.Status != EOperationStatus.Succeed)
Debug.LogError(destroyOp.Error);
Assert.AreEqual(EOperationStatus.Succeed, destroyOp.Status);
bool result = YooAssets.RemovePackage(TestDefine.RawBundlePackageName);
Assert.IsTrue(result);
}
var tester = new TestDestroyPackage();
yield return tester.RuntimeTester(true);
}
}

View File

@@ -16,53 +16,61 @@ public class TestBundleEncryption
ResourcePackage package = YooAssets.GetPackage(TestDefine.AssetBundlePackageName);
Assert.IsNotNull(package);
// 异步加载音乐播放预制体
// 异步加载加密的预制体
// 说明:测试内置文件解压
{
var assetHandle = package.LoadAssetAsync<GameObject>("prefab_audioA");
var assetHandle = package.LoadAssetAsync<GameObject>("prefab_encryptA");
yield return assetHandle;
Assert.AreEqual(EOperationStatus.Succeed, assetHandle.Status);
var go = assetHandle.InstantiateSync(Vector3.zero, Quaternion.identity);
Assert.IsNotNull(go);
var audioSource = go.GetComponent<AudioSource>();
Assert.IsNotNull(audioSource.clip);
}
// 同步加载音乐播放预制体
// 同步加载加密的预制体
// 说明:测试内置文件解压
{
var assetHandle = package.LoadAssetSync<GameObject>("prefab_audioB");
yield return assetHandle;
var assetHandle = package.LoadAssetSync<GameObject>("prefab_encryptB");
Assert.AreEqual(EOperationStatus.Succeed, assetHandle.Status);
var go = assetHandle.InstantiateSync(Vector3.zero, Quaternion.identity);
Assert.IsNotNull(go);
var audioSource = go.GetComponent<AudioSource>();
Assert.IsNotNull(audioSource.clip);
}
yield return new WaitForSeconds(1f);
}
}
/* 资源代码流程
* 内置文件解压(加载器)
* 内置文件解压(加载器触发
BuildinFileSystem::LoadBundleFile()
{
_unpackFileSystem.LoadBundleFile(bundle);
if (IsUnpackBundleFile(bundle))
{
_unpackFileSystem.LoadBundleFile(bundle);
}
}
UnpackFileSystem::LoadAssetBundleOperation()
UnpackFileSystem::LoadBundleFile()
{
DownloadFileOptions options = new DownloadFileOptions(int.MaxValue, 60);
_unpackFileSystem.DownloadFileAsync(_bundle, options);
var operation = new DCFSLoadAssetBundleOperation(this, bundle);
return operation;
}
DCFSLoadAssetBundleOperation::InternalUpdate()
{
if (_steps == ESteps.DownloadFile)
{
DownloadFileOptions options = new DownloadFileOptions(int.MaxValue);
_unpackFileSystem.DownloadFileAsync(_bundle, options);
}
}
UnpackFileSystem::DownloadFileAsync()
{
//RemoteServices返回内置文件路径
string mainURL = RemoteServices.GetRemoteMainURL(bundle.FileName);
string fallbackURL = RemoteServices.GetRemoteFallbackURL(bundle.FileName);
options.SetURL(mainURL, fallbackURL);
return new DownloadPackageBundleOperation(bundle, options);
if (string.IsNullOrEmpty(options.ImportFilePath))
{
//RemoteServices返回内置文件路径
string mainURL = RemoteServices.GetRemoteMainURL(bundle.FileName);
string fallbackURL = RemoteServices.GetRemoteFallbackURL(bundle.FileName);
options.SetURL(mainURL, fallbackURL);
var downloader = new DownloadPackageBundleOperation(bundle, options);
return downloader;
}
}
*/

View File

@@ -19,29 +19,31 @@ public class TestBundleUnpacker
var resourceUnpacker = package.CreateResourceUnpacker("unpack", 10, 1);
Assert.AreEqual(resourceUnpacker.TotalDownloadCount, 2);
resourceUnpacker.BeginDownload();
yield return resourceUnpacker;
Assert.AreEqual(EOperationStatus.Succeed, resourceUnpacker.Status);
// 等待一秒
yield return new WaitForSeconds(1f);
}
}
/* 资源代码流程
* 内置文件解压(解压器)
* 内置文件解压(解压器触发
BundleInfo::CreateDownloader()
{
return _buildFileSystem.DownloadFileAsync(Bundle, options);
}
BuildinFileSystem::DownloadFileAsync()
{
options.ImportFilePath = xxxxxx;
_unpackFileSystem.DownloadFileAsync(bundle, options);
options.ImportFilePath = GetBuildinFileLoadPath(bundle);
return _unpackFileSystem.DownloadFileAsync(bundle, options);
}
UnpackFileSystem::DownloadFileAsync()
{
string mainURL = ConvertToWWWPath(options.ImportFilePath);
options.SetURL(mainURL, mainURL);
return new DownloadPackageBundleOperation(bundle, options);
if (string.IsNullOrEmpty(options.ImportFilePath) == false)
{
string mainURL = ConvertToWWWPath(options.ImportFilePath);
options.SetURL(mainURL, mainURL);
var downloader = new DownloadPackageBundleOperation(bundle, options);
return downloader;
}
}
*/

View File

@@ -92,8 +92,6 @@ public class T3_TestCacheFileSystem : IPrebuildSetup, IPostBuildCleanup
}
}
[UnityTest]
public IEnumerator B1_TestBundlePlaying()
{
@@ -115,6 +113,13 @@ public class T3_TestCacheFileSystem : IPrebuildSetup, IPostBuildCleanup
yield return tester.RuntimeTester();
}
[UnityTest]
public IEnumerator D_DestroyPackage()
{
var tester = new TestDestroyPackage();
yield return tester.RuntimeTester(false);
}
private static void CopyDirectory(string sourceDir, string targetDir)
{
// 检查源目录是否存在

View File

@@ -17,31 +17,30 @@ public class TestBundleDownloader
Assert.IsNotNull(package);
var downloader = package.CreateResourceDownloader(10, 1);
if (downloader.TotalDownloadCount == 0)
{
Assert.Fail($"Test downloader not found any file !");
}
Assert.AreNotEqual(downloader.TotalDownloadCount, 0);
downloader.BeginDownload();
downloader.DownloadFinishCallback = (DownloaderFinishData data) =>
{
if (data.Succeed == false)
Assert.Fail($"Test downloader failed ! {downloader.Error}");
};
// 等待一秒
yield return new WaitForSeconds(1f);
yield return downloader;
Assert.AreEqual(EOperationStatus.Succeed, downloader.Status);
}
}
/* 资源代码流程
* 远端文件下载(下载器)
* 远端文件下载(下载器触发
BundleInfo::CreateDownloader()
{
return _buildFileSystem.DownloadFileAsync(Bundle, options);
}
CacheFileSystem::DownloadFileAsync()
{
//RemoteServices返回CDN文件路径
string mainURL = RemoteServices.GetRemoteMainURL(bundle.FileName);
string fallbackURL = RemoteServices.GetRemoteFallbackURL(bundle.FileName);
options.SetURL(mainURL, fallbackURL);
return new DownloadPackageBundleOperation(bundle, options);
if (string.IsNullOrEmpty(options.ImportFilePath))
{
//RemoteServices返回CDN文件路径
string mainURL = RemoteServices.GetRemoteMainURL(bundle.FileName);
string fallbackURL = RemoteServices.GetRemoteFallbackURL(bundle.FileName);
options.SetURL(mainURL, fallbackURL);
var downloader = new DownloadPackageBundleOperation(bundle, options);
return downloader;
}
}
*/

View File

@@ -35,14 +35,11 @@ public class TestBundleImporter
unpacker.BeginDownload();
yield return unpacker;
Assert.AreEqual(EOperationStatus.Succeed, unpacker.Status);
// 等待一秒
yield return new WaitForSeconds(1f);
}
}
/* 资源代码流程
* 本地文件导入(导入器)
* 本地文件导入(导入器触发
BundleInfo::CreateDownloader()
{
options.ImportFilePath = _importFilePath;
@@ -50,8 +47,12 @@ BundleInfo::CreateDownloader()
}
CacheFileSystem::DownloadFileAsync()
{
string mainURL = ConvertToWWWPath(options.ImportFilePath);
options.SetURL(mainURL, mainURL);
return new DownloadPackageBundleOperation(bundle, options);
if (string.IsNullOrEmpty(options.ImportFilePath) == false)
{
string mainURL = ConvertToWWWPath(options.ImportFilePath);
options.SetURL(mainURL, mainURL);
var downloader = new DownloadPackageBundleOperation(bundle, options);
return downloader;
}
}
*/

View File

@@ -16,28 +16,27 @@ public class TestBundlePlaying
ResourcePackage package = YooAssets.GetPackage(TestDefine.AssetBundlePackageName);
Assert.IsNotNull(package);
if (package.IsNeedDownloadFromRemote("panel_a") == false)
if (package.IsNeedDownloadFromRemote("prefab_encryptA") == false)
{
Assert.Fail("Load bundle is already existed !");
}
if (package.IsNeedDownloadFromRemote("panel_b") == false)
if (package.IsNeedDownloadFromRemote("prefab_encryptB") == false)
{
Assert.Fail("Load bundle is already existed !");
}
// 测试异步加载
// 测试异步加载远端资源
{
var assetsHandle = package.LoadAssetAsync<GameObject>("panel_a");
var assetsHandle = package.LoadAssetAsync<GameObject>("prefab_encryptA");
yield return assetsHandle;
Assert.AreEqual(EOperationStatus.Succeed, assetsHandle.Status);
}
// 测试同步加载
// 测试同步加载远端资源
{
// 验证失败结果
UnityEngine.TestTools.LogAssert.ignoreFailingMessages = true;
var assetsHandle = package.LoadAssetSync<GameObject>("panel_b");
yield return assetsHandle;
var assetsHandle = package.LoadAssetSync<GameObject>("prefab_encryptB");
Assert.AreEqual(EOperationStatus.Failed, assetsHandle.Status);
UnityEngine.TestTools.LogAssert.ignoreFailingMessages = false;
@@ -46,34 +45,38 @@ public class TestBundlePlaying
package.UnloadUnusedAssetsAsync();
// 验证成功结果
// 说明:同步加载也会触发远端下载任务!
yield return new WaitForSeconds(1f);
assetsHandle = package.LoadAssetSync<GameObject>("panel_b");
yield return assetsHandle;
assetsHandle = package.LoadAssetSync<GameObject>("prefab_encryptB");
Assert.AreEqual(EOperationStatus.Succeed, assetsHandle.Status);
}
// 等待一秒
yield return new WaitForSeconds(1f);
}
}
/* 资源代码流程
* 远端文件下载(加载器)
* 远端文件下载(加载器触发
CacheFileSystem::LoadBundleFile()
{
_cacheFileSystem.LoadBundleFile(bundle);
}
CacheFileSystem::LoadAssetBundleOperation()
DCFSLoadAssetBundleOperation::InternalUpdate()
{
DownloadFileOptions options = new DownloadFileOptions(int.MaxValue, 60);
_cacheFileSystem.DownloadFileAsync(_bundle, options);
if (_steps == ESteps.DownloadFile)
{
DownloadFileOptions options = new DownloadFileOptions(int.MaxValue);
_cacheFileSystem.DownloadFileAsync(_bundle, options);
}
}
CacheFileSystem::DownloadFileAsync()
{
//RemoteServices返回CDN文件路径
string mainURL = RemoteServices.GetRemoteMainURL(bundle.FileName);
string fallbackURL = RemoteServices.GetRemoteFallbackURL(bundle.FileName);
options.SetURL(mainURL, fallbackURL);
return new DownloadPackageBundleOperation(bundle, options);
if (string.IsNullOrEmpty(options.ImportFilePath))
{
//RemoteServices返回CDN文件路径
string mainURL = RemoteServices.GetRemoteMainURL(bundle.FileName);
string fallbackURL = RemoteServices.GetRemoteFallbackURL(bundle.FileName);
options.SetURL(mainURL, fallbackURL);
var downloader = new DownloadPackageBundleOperation(bundle, options);
return downloader;
}
}
*/

View File

@@ -0,0 +1,43 @@
using System;
using System.IO;
using System.Text;
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.U2D;
using UnityEngine.TestTools;
using NUnit.Framework;
using YooAsset;
public class TestDestroyPackage
{
public IEnumerator RuntimeTester(bool destroyRawPackage)
{
// 销毁旧资源包 ASSET_BUNDLE
{
var package = YooAssets.GetPackage(TestDefine.AssetBundlePackageName);
var destroyOp = package.DestroyAsync();
yield return destroyOp;
if (destroyOp.Status != EOperationStatus.Succeed)
Debug.LogError(destroyOp.Error);
Assert.AreEqual(EOperationStatus.Succeed, destroyOp.Status);
bool result = YooAssets.RemovePackage(TestDefine.AssetBundlePackageName);
Assert.IsTrue(result);
}
// 销毁旧资源包 RAW_BUNDLE
if (destroyRawPackage)
{
var package = YooAssets.GetPackage(TestDefine.RawBundlePackageName);
var destroyOp = package.DestroyAsync();
yield return destroyOp;
if (destroyOp.Status != EOperationStatus.Succeed)
Debug.LogError(destroyOp.Error);
Assert.AreEqual(EOperationStatus.Succeed, destroyOp.Status);
bool result = YooAssets.RemovePackage(TestDefine.RawBundlePackageName);
Assert.IsTrue(result);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2772d71ea8e24f844b0ad661a3c85ee6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,44 @@
using System;
using System.IO;
using System.Text;
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.U2D;
using UnityEngine.TestTools;
using NUnit.Framework;
using YooAsset;
public class TestLoadAllAssets
{
public IEnumerator RuntimeTester()
{
ResourcePackage package = YooAssets.GetPackage(TestDefine.AssetBundlePackageName);
Assert.IsNotNull(package);
// 异步加载所有资源
{
var allAssetsHandle = package.LoadAllAssetsAsync<GameObject>("prefab_a");
yield return allAssetsHandle;
Assert.AreEqual(EOperationStatus.Succeed, allAssetsHandle.Status);
var allAssetObjects = allAssetsHandle.AllAssetObjects;
Assert.IsNotNull(allAssetObjects);
int count = allAssetObjects.Count;
Assert.AreEqual(count, 3);
}
// 同步加载所有资源
{
var allAssetsHandle = package.LoadAllAssetsSync<GameObject>("prefab_x");
Assert.AreEqual(EOperationStatus.Succeed, allAssetsHandle.Status);
var allAssetObjects = allAssetsHandle.AllAssetObjects;
Assert.IsNotNull(allAssetObjects);
int count = allAssetObjects.Count;
Assert.AreEqual(count, 3);
}
}
}

View File

@@ -9,14 +9,14 @@ using UnityEngine.TestTools;
using NUnit.Framework;
using YooAsset;
public class TestLoadAudio
public class TestLoadAsset
{
public IEnumerator RuntimeTester()
{
ResourcePackage package = YooAssets.GetPackage(TestDefine.AssetBundlePackageName);
Assert.IsNotNull(package);
// 音乐异步加载
// 异步加载音乐
{
var assetHandle = package.LoadAssetAsync<AudioClip>("music_a");
yield return assetHandle;
@@ -26,7 +26,7 @@ public class TestLoadAudio
Assert.IsNotNull(audioClip);
}
// 音效异步加载
// 异步加载音效
{
var assetHandle = package.LoadAssetAsync<AudioClip>("sound_a");
yield return assetHandle;
@@ -36,10 +36,9 @@ public class TestLoadAudio
Assert.IsNotNull(audioClip);
}
// 音效同步加载
// 同步加载音效
{
var assetHandle = package.LoadAssetSync<AudioClip>("sound_b");
yield return assetHandle;
Assert.AreEqual(EOperationStatus.Succeed, assetHandle.Status);
var audioClip = assetHandle.AssetObject as AudioClip;

View File

@@ -10,16 +10,16 @@ using UnityEngine.TestTools;
using NUnit.Framework;
using YooAsset;
public class TestLoadPanel
public class TestAsyncTask
{
public IEnumerator RuntimeTester()
{
ResourcePackage package = YooAssets.GetPackage(TestDefine.AssetBundlePackageName);
Assert.IsNotNull(package);
// 异步加载面板
// Task异步加载面板
{
var assetsHandle = package.LoadAssetAsync<GameObject>("panel_canvas");
var assetsHandle = package.LoadAssetAsync<GameObject>("canvas");
var handleTask = assetsHandle.Task;
while (!handleTask.IsCompleted)
yield return null;
@@ -28,7 +28,7 @@ public class TestLoadPanel
var instantiateOp = assetsHandle.InstantiateAsync();
var operationTask = instantiateOp.Task;
while (!handleTask.IsCompleted)
while (!operationTask.IsCompleted)
yield return null;
yield return null;
Assert.AreEqual(EOperationStatus.Succeed, instantiateOp.Status);

View File

@@ -1,64 +0,0 @@
using System;
using System.IO;
using System.Text;
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.U2D;
using UnityEngine.TestTools;
using NUnit.Framework;
using YooAsset;
public class TestLoadPrefab
{
public IEnumerator RuntimeTester()
{
ResourcePackage package = YooAssets.GetPackage(TestDefine.AssetBundlePackageName);
Assert.IsNotNull(package);
// 异步加载所有预制体
{
var allAssetsHandle = package.LoadAllAssetsAsync<GameObject>("prefab_a");
yield return allAssetsHandle;
Assert.AreEqual(EOperationStatus.Succeed, allAssetsHandle.Status);
var allAssetObjects = allAssetsHandle.AllAssetObjects;
Assert.IsNotNull(allAssetObjects);
int count = allAssetObjects.Count;
Assert.AreEqual(count, 3);
}
// 异步加载指定预制体
{
var assetsHandle = package.LoadAssetAsync<GameObject>("prefab_b");
yield return assetsHandle;
Assert.AreEqual(EOperationStatus.Succeed, assetsHandle.Status);
Assert.IsNotNull(assetsHandle.AssetObject);
var instantiateOp = assetsHandle.InstantiateAsync();
yield return instantiateOp;
Assert.AreEqual(EOperationStatus.Succeed, instantiateOp.Status);
Assert.IsNotNull(instantiateOp.Result);
TestLogger.Log(this, instantiateOp.Result.name);
GameObject.Destroy(instantiateOp.Result);
}
// 同步加载指定预制体
{
var assetsHandle = package.LoadAssetSync<GameObject>("prefab_c");
yield return assetsHandle;
Assert.AreEqual(EOperationStatus.Succeed, assetsHandle.Status);
Assert.IsNotNull(assetsHandle.AssetObject);
var instantiateOp = assetsHandle.InstantiateAsync();
yield return instantiateOp;
Assert.AreEqual(EOperationStatus.Succeed, instantiateOp.Status);
Assert.IsNotNull(instantiateOp.Result);
TestLogger.Log(this, instantiateOp.Result.name);
GameObject.Destroy(instantiateOp.Result);
}
}
}

View File

@@ -27,11 +27,10 @@ public class TestLoadScene
Assert.IsNotNull(scene);
}
// 步加载附加场景
yield return new WaitForSeconds(1f);
// 步加载附加场景
yield return new WaitForSeconds(0.2f);
{
var sceneHandle = package.LoadSceneAsync("scene_b", LoadSceneMode.Additive);
yield return sceneHandle;
var sceneHandle = package.LoadSceneSync("scene_b", LoadSceneMode.Additive);
Assert.AreEqual(EOperationStatus.Succeed, sceneHandle.Status);
var scene = sceneHandle.SceneObject;
@@ -39,18 +38,21 @@ public class TestLoadScene
}
// 异步加载附加场景
yield return new WaitForSeconds(1f);
yield return new WaitForSeconds(0.2f);
SceneHandle cachedHandle;
{
var sceneHandle = package.LoadSceneSync("scene_c", LoadSceneMode.Additive);
yield return sceneHandle;
Assert.AreEqual(EOperationStatus.Succeed, sceneHandle.Status);
cachedHandle = package.LoadSceneSync("scene_c", LoadSceneMode.Additive);
yield return cachedHandle;
Assert.AreEqual(EOperationStatus.Succeed, cachedHandle.Status);
var scene = sceneHandle.SceneObject;
var scene = cachedHandle.SceneObject;
Assert.IsNotNull(scene);
}
// 异步销毁附加场景
yield return new WaitForSeconds(1f);
var unloadSceneOp = sceneHandle.UnloadAsync();
// 异步销毁附加场景
yield return new WaitForSeconds(0.2f);
{
var unloadSceneOp = cachedHandle.UnloadAsync();
yield return unloadSceneOp;
Assert.AreEqual(EOperationStatus.Succeed, unloadSceneOp.Status);
}

View File

@@ -9,7 +9,7 @@ using UnityEngine.TestTools;
using NUnit.Framework;
using YooAsset;
public class TestLoadImage
public class TestLoadSubAssets
{
public IEnumerator RuntimeTester()
{
@@ -32,7 +32,6 @@ public class TestLoadImage
// 同步加载子对象
{
var subAssetsHandle = package.LoadSubAssetsSync<Sprite>("image_b");
yield return subAssetsHandle;
Assert.AreEqual(EOperationStatus.Succeed, subAssetsHandle.Status);
var subAssetObjects = subAssetsHandle.SubAssetObjects;

View File

@@ -12,7 +12,7 @@ GameObject:
- component: {fileID: 7980853937325680292}
- component: {fileID: -2226153785594138141}
m_Layer: 0
m_Name: panel_canvas
m_Name: canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 8c5a1726d94498e4cbe30f5f510cc796
guid: fb1303d9729dc8d4fb0846570e02feeb
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -12,7 +12,7 @@ GameObject:
- component: {fileID: 7980853937325680292}
- component: {fileID: 8207247306684829080}
m_Layer: 0
m_Name: panel_a
m_Name: prefab_a
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -78,4 +78,4 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: this is panel a !
m_Text: this is prefab a !

View File

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

View File

@@ -12,7 +12,7 @@ GameObject:
- component: {fileID: 7980853937325680292}
- component: {fileID: 8207247306684829080}
m_Layer: 0
m_Name: panel_b
m_Name: prefab_x
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -78,4 +78,4 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: this is panel b !
m_Text: this is prefab x !

View File

@@ -0,0 +1,81 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6283027362666271047
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2037322908504346998}
- component: {fileID: 7980853937325680292}
- component: {fileID: 8207247306684829080}
m_Layer: 0
m_Name: prefab_y
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2037322908504346998
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6283027362666271047}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7980853937325680292
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6283027362666271047}
m_CullTransparentMesh: 1
--- !u!114 &8207247306684829080
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6283027362666271047}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: this is prefab y !

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 742458f8f1eb9a74e840f3a6d3043678
guid: a195cd63c03b9874a9dfe44d900af0b1
PrefabImporter:
externalObjects: {}
userData:

View File

@@ -0,0 +1,81 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6283027362666271047
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2037322908504346998}
- component: {fileID: 7980853937325680292}
- component: {fileID: 8207247306684829080}
m_Layer: 0
m_Name: prefab_z
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2037322908504346998
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6283027362666271047}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7980853937325680292
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6283027362666271047}
m_CullTransparentMesh: 1
--- !u!114 &8207247306684829080
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6283027362666271047}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: this is prefab z !

View File

@@ -1,157 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3668533437794098342
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3261458243953667020}
- component: {fileID: 5426642485336130165}
- component: {fileID: 594853164802008002}
m_Layer: 0
m_Name: Image
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3261458243953667020
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3668533437794098342}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2037322908504346998}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5426642485336130165
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3668533437794098342}
m_CullTransparentMesh: 1
--- !u!114 &594853164802008002
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3668533437794098342}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: fcab35236e33438448805a9211b0cc19, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &6283027362666271047
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2037322908504346998}
- component: {fileID: 7980853937325680292}
- component: {fileID: 8207247306684829080}
m_Layer: 0
m_Name: prefab_a
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2037322908504346998
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6283027362666271047}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 3261458243953667020}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7980853937325680292
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6283027362666271047}
m_CullTransparentMesh: 1
--- !u!114 &8207247306684829080
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6283027362666271047}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: this is prefab a !

View File

@@ -0,0 +1,33 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3749121449083481702
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1740794871874781600}
m_Layer: 0
m_Name: prefab_encryptA
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1740794871874781600
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3749121449083481702}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 10, z: 5}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: ea7f727cf3cd1b7499c5431e766891c3
guid: dea81ae820568154d99b261bdd0fa219
PrefabImporter:
externalObjects: {}
userData:

View File

@@ -0,0 +1,33 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3749121449083481702
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1740794871874781600}
m_Layer: 0
m_Name: prefab_encryptB
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1740794871874781600
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3749121449083481702}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 10, z: 5}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 847cd108cfb092c4989bb5ad15381409
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,59 +0,0 @@
fileFormatVersion: 2
guid: cec4a3bb047ca4e478315ee5c98fa75a
AudioImporter:
externalObjects: {}
serializedVersion: 7
defaultSettings:
serializedVersion: 2
loadType: 2
sampleRateSetting: 0
sampleRateOverride: 0
compressionFormat: 1
quality: 0.5
conversionMode: 0
preloadAudioData: 1
platformSettingOverrides:
1:
serializedVersion: 2
loadType: 2
sampleRateSetting: 0
sampleRateOverride: 0
compressionFormat: 1
quality: 0.5
conversionMode: 0
preloadAudioData: 1
4:
serializedVersion: 2
loadType: 2
sampleRateSetting: 0
sampleRateOverride: 0
compressionFormat: 1
quality: 0.5
conversionMode: 0
preloadAudioData: 1
7:
serializedVersion: 2
loadType: 2
sampleRateSetting: 0
sampleRateOverride: 0
compressionFormat: 1
quality: 0.5
conversionMode: 0
preloadAudioData: 1
13:
serializedVersion: 2
loadType: 2
sampleRateSetting: 2
sampleRateOverride: 44100
compressionFormat: 7
quality: 0.5
conversionMode: 0
preloadAudioData: 1
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,59 +0,0 @@
fileFormatVersion: 2
guid: 502e4faa60c5fc441a6a8ae9a61fbf35
AudioImporter:
externalObjects: {}
serializedVersion: 7
defaultSettings:
serializedVersion: 2
loadType: 2
sampleRateSetting: 0
sampleRateOverride: 0
compressionFormat: 1
quality: 0.5
conversionMode: 0
preloadAudioData: 1
platformSettingOverrides:
1:
serializedVersion: 2
loadType: 2
sampleRateSetting: 0
sampleRateOverride: 0
compressionFormat: 1
quality: 0.5
conversionMode: 0
preloadAudioData: 1
4:
serializedVersion: 2
loadType: 2
sampleRateSetting: 0
sampleRateOverride: 0
compressionFormat: 1
quality: 0.5
conversionMode: 0
preloadAudioData: 1
7:
serializedVersion: 2
loadType: 2
sampleRateSetting: 0
sampleRateOverride: 0
compressionFormat: 1
quality: 0.5
conversionMode: 0
preloadAudioData: 1
13:
serializedVersion: 2
loadType: 2
sampleRateSetting: 2
sampleRateOverride: 44100
compressionFormat: 7
quality: 0.5
conversionMode: 0
preloadAudioData: 1
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,130 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3749121449083481702
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1740794871874781600}
- component: {fileID: 8364371343008149393}
m_Layer: 0
m_Name: prefab_audioA
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1740794871874781600
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3749121449083481702}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -1.5441012, y: -1.4355755, z: -5.0895267}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &8364371343008149393
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3749121449083481702}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: cec4a3bb047ca4e478315ee5c98fa75a, type: 3}
m_PlayOnAwake: 1
m_Volume: 1
m_Pitch: 1
Loop: 1
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4

View File

@@ -1,130 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3749121449083481702
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1740794871874781600}
- component: {fileID: 8364371343008149393}
m_Layer: 0
m_Name: prefab_audioB
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1740794871874781600
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3749121449083481702}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -1.5441012, y: -1.4355755, z: -5.0895267}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &8364371343008149393
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3749121449083481702}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: 502e4faa60c5fc441a6a8ae9a61fbf35, type: 3}
m_PlayOnAwake: 1
m_Volume: 1
m_Pitch: 1
Loop: 1
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4