parent
a6fdb5691a
commit
dcd4475617
|
@ -149,7 +149,7 @@ namespace YooAsset
|
||||||
private InstantiateOperation InstantiateAsyncInternal(Vector3 position, Quaternion rotation, Transform parent, bool setPositionRotation)
|
private InstantiateOperation InstantiateAsyncInternal(Vector3 position, Quaternion rotation, Transform parent, bool setPositionRotation)
|
||||||
{
|
{
|
||||||
InstantiateOperation operation = new InstantiateOperation(this, position, rotation, parent, setPositionRotation);
|
InstantiateOperation operation = new InstantiateOperation(this, position, rotation, parent, setPositionRotation);
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,7 @@ namespace YooAsset
|
||||||
{
|
{
|
||||||
string error = $"{nameof(SceneOperationHandle)} is invalid.";
|
string error = $"{nameof(SceneOperationHandle)} is invalid.";
|
||||||
var operation = new UnloadSceneOperation(error);
|
var operation = new UnloadSceneOperation(error);
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ namespace YooAsset
|
||||||
string error = $"Cannot unload main scene. Use {nameof(YooAssets.LoadSceneAsync)} method to change the main scene !";
|
string error = $"Cannot unload main scene. Use {nameof(YooAssets.LoadSceneAsync)} method to change the main scene !";
|
||||||
YooLogger.Error(error);
|
YooLogger.Error(error);
|
||||||
var operation = new UnloadSceneOperation(error);
|
var operation = new UnloadSceneOperation(error);
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ namespace YooAsset
|
||||||
AssetSystem.UnloadSubScene(Provider);
|
AssetSystem.UnloadSubScene(Provider);
|
||||||
{
|
{
|
||||||
var operation = new UnloadSceneOperation(sceneObject);
|
var operation = new UnloadSceneOperation(sceneObject);
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ namespace YooAsset
|
||||||
// 注意:如果是APP资源并且哈希值相同,则不需要下载
|
// 注意:如果是APP资源并且哈希值相同,则不需要下载
|
||||||
if (appPatchManifest.TryGetPatchBundle(patchBundle.BundleName, out PatchBundle appPatchBundle))
|
if (appPatchManifest.TryGetPatchBundle(patchBundle.BundleName, out PatchBundle appPatchBundle))
|
||||||
{
|
{
|
||||||
if (appPatchBundle.IsBuildin && appPatchBundle.FileHash == patchBundle.FileHash)
|
if (appPatchBundle.IsBuildin && appPatchBundle.Equals(patchBundle))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ namespace YooAsset
|
||||||
// 注意:如果是APP资源并且哈希值相同,则不需要下载
|
// 注意:如果是APP资源并且哈希值相同,则不需要下载
|
||||||
if (appPatchManifest.TryGetPatchBundle(patchBundle.BundleName, out PatchBundle appPatchBundle))
|
if (appPatchManifest.TryGetPatchBundle(patchBundle.BundleName, out PatchBundle appPatchBundle))
|
||||||
{
|
{
|
||||||
if (appPatchBundle.IsBuildin && appPatchBundle.FileHash == patchBundle.FileHash)
|
if (appPatchBundle.IsBuildin && appPatchBundle.Equals(patchBundle))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ namespace YooAsset
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 开始处理异步操作类
|
/// 开始处理异步操作类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void StartOperaiton(AsyncOperationBase operationBase)
|
public static void StartOperation(AsyncOperationBase operationBase)
|
||||||
{
|
{
|
||||||
_operations.Add(operationBase);
|
_operations.Add(operationBase);
|
||||||
operationBase.Start();
|
operationBase.Start();
|
||||||
|
|
|
@ -205,7 +205,7 @@ namespace YooAsset
|
||||||
{
|
{
|
||||||
if (_steps == ESteps.None)
|
if (_steps == ESteps.None)
|
||||||
{
|
{
|
||||||
OperationSystem.StartOperaiton(this);
|
OperationSystem.StartOperation(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -205,7 +205,7 @@ namespace YooAsset
|
||||||
// 注意:如果是APP资源并且哈希值相同,则不需要下载
|
// 注意:如果是APP资源并且哈希值相同,则不需要下载
|
||||||
if (_impl.AppPatchManifest.TryGetPatchBundle(patchBundle.BundleName, out PatchBundle appPatchBundle))
|
if (_impl.AppPatchManifest.TryGetPatchBundle(patchBundle.BundleName, out PatchBundle appPatchBundle))
|
||||||
{
|
{
|
||||||
if (appPatchBundle.IsBuildin && appPatchBundle.FileHash == patchBundle.FileHash)
|
if (appPatchBundle.IsBuildin && appPatchBundle.Equals(patchBundle))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -160,5 +160,16 @@ namespace YooAsset
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 检测资源包文件内容是否相同
|
||||||
|
/// </summary>
|
||||||
|
public bool Equals(PatchBundle otherBundle)
|
||||||
|
{
|
||||||
|
if (FileHash == otherBundle.FileHash)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -16,7 +16,7 @@ namespace YooAsset
|
||||||
{
|
{
|
||||||
_locationToLower = locationToLower;
|
_locationToLower = locationToLower;
|
||||||
var operation = new EditorSimulateModeInitializationOperation(this, simulatePatchManifestPath);
|
var operation = new EditorSimulateModeInitializationOperation(this, simulatePatchManifestPath);
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ namespace YooAsset
|
||||||
_fallbackHostServer = fallbackHostServer;
|
_fallbackHostServer = fallbackHostServer;
|
||||||
|
|
||||||
var operation = new HostPlayModeInitializationOperation(this);
|
var operation = new HostPlayModeInitializationOperation(this);
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ namespace YooAsset
|
||||||
public UpdateStaticVersionOperation UpdateStaticVersionAsync(int timeout)
|
public UpdateStaticVersionOperation UpdateStaticVersionAsync(int timeout)
|
||||||
{
|
{
|
||||||
var operation = new HostPlayModeUpdateStaticVersionOperation(this, timeout);
|
var operation = new HostPlayModeUpdateStaticVersionOperation(this, timeout);
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ namespace YooAsset
|
||||||
public UpdateManifestOperation UpdatePatchManifestAsync(int resourceVersion, int timeout)
|
public UpdateManifestOperation UpdatePatchManifestAsync(int resourceVersion, int timeout)
|
||||||
{
|
{
|
||||||
var operation = new HostPlayModeUpdateManifestOperation(this, resourceVersion, timeout);
|
var operation = new HostPlayModeUpdateManifestOperation(this, resourceVersion, timeout);
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ namespace YooAsset
|
||||||
public UpdateManifestOperation WeaklyUpdatePatchManifestAsync(int resourceVersion)
|
public UpdateManifestOperation WeaklyUpdatePatchManifestAsync(int resourceVersion)
|
||||||
{
|
{
|
||||||
var operation = new HostPlayModeWeaklyUpdateManifestOperation(this, resourceVersion);
|
var operation = new HostPlayModeWeaklyUpdateManifestOperation(this, resourceVersion);
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ namespace YooAsset
|
||||||
public UpdatePackageOperation UpdatePackageAsync(int resourceVersion, int timeout)
|
public UpdatePackageOperation UpdatePackageAsync(int resourceVersion, int timeout)
|
||||||
{
|
{
|
||||||
var operation = new HostPlayModeUpdatePackageOperation(this, resourceVersion, timeout);
|
var operation = new HostPlayModeUpdatePackageOperation(this, resourceVersion, timeout);
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ namespace YooAsset
|
||||||
// 注意:如果是APP资源并且哈希值相同,则不需要下载
|
// 注意:如果是APP资源并且哈希值相同,则不需要下载
|
||||||
if (AppPatchManifest.TryGetPatchBundle(patchBundle.BundleName, out PatchBundle appPatchBundle))
|
if (AppPatchManifest.TryGetPatchBundle(patchBundle.BundleName, out PatchBundle appPatchBundle))
|
||||||
{
|
{
|
||||||
if (appPatchBundle.IsBuildin && appPatchBundle.FileHash == patchBundle.FileHash)
|
if (appPatchBundle.IsBuildin && appPatchBundle.Equals(patchBundle))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ namespace YooAsset
|
||||||
// 注意:如果是APP资源并且哈希值相同,则不需要下载
|
// 注意:如果是APP资源并且哈希值相同,则不需要下载
|
||||||
if (AppPatchManifest.TryGetPatchBundle(patchBundle.BundleName, out PatchBundle appPatchBundle))
|
if (AppPatchManifest.TryGetPatchBundle(patchBundle.BundleName, out PatchBundle appPatchBundle))
|
||||||
{
|
{
|
||||||
if (appPatchBundle.IsBuildin && appPatchBundle.FileHash == patchBundle.FileHash)
|
if (appPatchBundle.IsBuildin && appPatchBundle.Equals(patchBundle))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,7 +240,7 @@ namespace YooAsset
|
||||||
// 注意:如果是APP资源并且哈希值相同,则不需要下载
|
// 注意:如果是APP资源并且哈希值相同,则不需要下载
|
||||||
if (AppPatchManifest.TryGetPatchBundle(patchBundle.BundleName, out PatchBundle appPatchBundle))
|
if (AppPatchManifest.TryGetPatchBundle(patchBundle.BundleName, out PatchBundle appPatchBundle))
|
||||||
{
|
{
|
||||||
if (appPatchBundle.IsBuildin && appPatchBundle.FileHash == patchBundle.FileHash)
|
if (appPatchBundle.IsBuildin && appPatchBundle.Equals(patchBundle))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -386,7 +386,7 @@ namespace YooAsset
|
||||||
// 查询APP资源
|
// 查询APP资源
|
||||||
if (AppPatchManifest.TryGetPatchBundle(patchBundle.BundleName, out PatchBundle appPatchBundle))
|
if (AppPatchManifest.TryGetPatchBundle(patchBundle.BundleName, out PatchBundle appPatchBundle))
|
||||||
{
|
{
|
||||||
if (appPatchBundle.IsBuildin && appPatchBundle.FileHash == patchBundle.FileHash)
|
if (appPatchBundle.IsBuildin && appPatchBundle.Equals(patchBundle))
|
||||||
{
|
{
|
||||||
BundleInfo bundleInfo = new BundleInfo(appPatchBundle, BundleInfo.ELoadMode.LoadFromStreaming);
|
BundleInfo bundleInfo = new BundleInfo(appPatchBundle, BundleInfo.ELoadMode.LoadFromStreaming);
|
||||||
return bundleInfo;
|
return bundleInfo;
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace YooAsset
|
||||||
{
|
{
|
||||||
_locationToLower = locationToLower;
|
_locationToLower = locationToLower;
|
||||||
var operation = new OfflinePlayModeInitializationOperation(this);
|
var operation = new OfflinePlayModeInitializationOperation(this);
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -261,13 +261,13 @@ namespace YooAsset
|
||||||
if (_playMode == EPlayMode.EditorSimulateMode)
|
if (_playMode == EPlayMode.EditorSimulateMode)
|
||||||
{
|
{
|
||||||
var operation = new EditorPlayModeUpdateStaticVersionOperation();
|
var operation = new EditorPlayModeUpdateStaticVersionOperation();
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else if (_playMode == EPlayMode.OfflinePlayMode)
|
else if (_playMode == EPlayMode.OfflinePlayMode)
|
||||||
{
|
{
|
||||||
var operation = new OfflinePlayModeUpdateStaticVersionOperation();
|
var operation = new OfflinePlayModeUpdateStaticVersionOperation();
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else if (_playMode == EPlayMode.HostPlayMode)
|
else if (_playMode == EPlayMode.HostPlayMode)
|
||||||
|
@ -291,13 +291,13 @@ namespace YooAsset
|
||||||
if (_playMode == EPlayMode.EditorSimulateMode)
|
if (_playMode == EPlayMode.EditorSimulateMode)
|
||||||
{
|
{
|
||||||
var operation = new EditorPlayModeUpdateManifestOperation();
|
var operation = new EditorPlayModeUpdateManifestOperation();
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else if (_playMode == EPlayMode.OfflinePlayMode)
|
else if (_playMode == EPlayMode.OfflinePlayMode)
|
||||||
{
|
{
|
||||||
var operation = new OfflinePlayModeUpdateManifestOperation();
|
var operation = new OfflinePlayModeUpdateManifestOperation();
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else if (_playMode == EPlayMode.HostPlayMode)
|
else if (_playMode == EPlayMode.HostPlayMode)
|
||||||
|
@ -321,13 +321,13 @@ namespace YooAsset
|
||||||
if (_playMode == EPlayMode.EditorSimulateMode)
|
if (_playMode == EPlayMode.EditorSimulateMode)
|
||||||
{
|
{
|
||||||
var operation = new EditorPlayModeUpdateManifestOperation();
|
var operation = new EditorPlayModeUpdateManifestOperation();
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else if (_playMode == EPlayMode.OfflinePlayMode)
|
else if (_playMode == EPlayMode.OfflinePlayMode)
|
||||||
{
|
{
|
||||||
var operation = new OfflinePlayModeUpdateManifestOperation();
|
var operation = new OfflinePlayModeUpdateManifestOperation();
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else if (_playMode == EPlayMode.HostPlayMode)
|
else if (_playMode == EPlayMode.HostPlayMode)
|
||||||
|
@ -344,9 +344,9 @@ namespace YooAsset
|
||||||
/// 开启一个异步操作
|
/// 开启一个异步操作
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="operation">异步操作对象</param>
|
/// <param name="operation">异步操作对象</param>
|
||||||
public static void StartOperaiton(GameAsyncOperation operation)
|
public static void StartOperation(GameAsyncOperation operation)
|
||||||
{
|
{
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -512,7 +512,7 @@ namespace YooAsset
|
||||||
if (assetInfo.IsInvalid)
|
if (assetInfo.IsInvalid)
|
||||||
{
|
{
|
||||||
RawFileOperation operation = new CompletedRawFileOperation(assetInfo.Error, copyPath);
|
RawFileOperation operation = new CompletedRawFileOperation(assetInfo.Error, copyPath);
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -522,26 +522,26 @@ namespace YooAsset
|
||||||
string error = $"Cannot load asset bundle file using {nameof(GetRawFileAsync)} interfaces !";
|
string error = $"Cannot load asset bundle file using {nameof(GetRawFileAsync)} interfaces !";
|
||||||
YooLogger.Warning(error);
|
YooLogger.Warning(error);
|
||||||
RawFileOperation operation = new CompletedRawFileOperation(error, copyPath);
|
RawFileOperation operation = new CompletedRawFileOperation(error, copyPath);
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_playMode == EPlayMode.EditorSimulateMode)
|
if (_playMode == EPlayMode.EditorSimulateMode)
|
||||||
{
|
{
|
||||||
RawFileOperation operation = new EditorPlayModeRawFileOperation(bundleInfo, copyPath);
|
RawFileOperation operation = new EditorPlayModeRawFileOperation(bundleInfo, copyPath);
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else if (_playMode == EPlayMode.OfflinePlayMode)
|
else if (_playMode == EPlayMode.OfflinePlayMode)
|
||||||
{
|
{
|
||||||
RawFileOperation operation = new OfflinePlayModeRawFileOperation(bundleInfo, copyPath);
|
RawFileOperation operation = new OfflinePlayModeRawFileOperation(bundleInfo, copyPath);
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else if (_playMode == EPlayMode.HostPlayMode)
|
else if (_playMode == EPlayMode.HostPlayMode)
|
||||||
{
|
{
|
||||||
RawFileOperation operation = new HostPlayModeRawFileOperation(bundleInfo, copyPath);
|
RawFileOperation operation = new HostPlayModeRawFileOperation(bundleInfo, copyPath);
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -959,13 +959,13 @@ namespace YooAsset
|
||||||
if (_playMode == EPlayMode.EditorSimulateMode)
|
if (_playMode == EPlayMode.EditorSimulateMode)
|
||||||
{
|
{
|
||||||
var operation = new EditorPlayModeUpdatePackageOperation();
|
var operation = new EditorPlayModeUpdatePackageOperation();
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else if (_playMode == EPlayMode.OfflinePlayMode)
|
else if (_playMode == EPlayMode.OfflinePlayMode)
|
||||||
{
|
{
|
||||||
var operation = new OfflinePlayModeUpdatePackageOperation();
|
var operation = new OfflinePlayModeUpdatePackageOperation();
|
||||||
OperationSystem.StartOperaiton(operation);
|
OperationSystem.StartOperation(operation);
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
else if (_playMode == EPlayMode.HostPlayMode)
|
else if (_playMode == EPlayMode.HostPlayMode)
|
||||||
|
|
Loading…
Reference in New Issue