From 42703def02906c6465d43fc4f0c11432301adb8c Mon Sep 17 00:00:00 2001 From: hevinci Date: Sat, 7 May 2022 18:23:00 +0800 Subject: [PATCH] Add process operation method. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加开启异步操作的方法。 --- .../OperationSystem/GameAsyncOperation.cs | 18 ++++++++++++++++++ .../OperationSystem/GameAsyncOperation.cs.meta | 11 +++++++++++ Assets/YooAsset/Runtime/YooAssets.cs | 9 +++++++++ 3 files changed, 38 insertions(+) create mode 100644 Assets/YooAsset/Runtime/OperationSystem/GameAsyncOperation.cs create mode 100644 Assets/YooAsset/Runtime/OperationSystem/GameAsyncOperation.cs.meta diff --git a/Assets/YooAsset/Runtime/OperationSystem/GameAsyncOperation.cs b/Assets/YooAsset/Runtime/OperationSystem/GameAsyncOperation.cs new file mode 100644 index 0000000..fe8b2ae --- /dev/null +++ b/Assets/YooAsset/Runtime/OperationSystem/GameAsyncOperation.cs @@ -0,0 +1,18 @@ + +namespace YooAsset +{ + public class GameAsyncOperation : AsyncOperationBase + { + internal override void Start() + { + OnStart(); + } + internal override void Update() + { + OnUpdate(); + } + + protected virtual void OnStart() { } + protected virtual void OnUpdate() { } + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Runtime/OperationSystem/GameAsyncOperation.cs.meta b/Assets/YooAsset/Runtime/OperationSystem/GameAsyncOperation.cs.meta new file mode 100644 index 0000000..90cbe4b --- /dev/null +++ b/Assets/YooAsset/Runtime/OperationSystem/GameAsyncOperation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ff8a96dd005f55346986f8a98aff8c99 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/YooAsset/Runtime/YooAssets.cs b/Assets/YooAsset/Runtime/YooAssets.cs index 49a0fab..1acef15 100644 --- a/Assets/YooAsset/Runtime/YooAssets.cs +++ b/Assets/YooAsset/Runtime/YooAssets.cs @@ -286,6 +286,15 @@ namespace YooAsset } } + /// + /// 开启一个异步操作 + /// + /// 异步操作对象 + public static void ProcessOperaiton(GameAsyncOperation operation) + { + OperationSystem.ProcessOperaiton(operation); + } + /// /// 获取资源版本号 ///