From c5ca825b25da6bf37b685399c2fe9034a6dc70c6 Mon Sep 17 00:00:00 2001 From: L <401419353@qq.com> Date: Tue, 9 Aug 2022 20:49:03 +0800 Subject: [PATCH] Update UniTask Sample --- .../Samples~/UniTask Sample/README.md | 25 +++++++++++++++---- .../UniTask Sample/UniTask.YooAsset.asmdef | 17 ------------- .../UniTask/Runtime/External/YooAsset.meta | 8 ++++++ .../YooAsset}/AsyncOperationBaseExtensions.cs | 0 .../AsyncOperationBaseExtensions.cs.meta | 0 .../OperationHandleBaseExtensions.cs | 0 .../OperationHandleBaseExtensions.cs.meta | 0 .../UniTask/Runtime/UniTask.asmdef | 4 ++- 8 files changed, 31 insertions(+), 23 deletions(-) delete mode 100644 Assets/YooAsset/Samples~/UniTask Sample/UniTask.YooAsset.asmdef create mode 100644 Assets/YooAsset/Samples~/UniTask Sample/UniTask/Runtime/External/YooAsset.meta rename Assets/YooAsset/Samples~/UniTask Sample/{ => UniTask/Runtime/External/YooAsset}/AsyncOperationBaseExtensions.cs (100%) rename Assets/YooAsset/Samples~/UniTask Sample/{ => UniTask/Runtime/External/YooAsset}/AsyncOperationBaseExtensions.cs.meta (100%) rename Assets/YooAsset/Samples~/UniTask Sample/{ => UniTask/Runtime/External/YooAsset}/OperationHandleBaseExtensions.cs (100%) rename Assets/YooAsset/Samples~/UniTask Sample/{ => UniTask/Runtime/External/YooAsset}/OperationHandleBaseExtensions.cs.meta (100%) diff --git a/Assets/YooAsset/Samples~/UniTask Sample/README.md b/Assets/YooAsset/Samples~/UniTask Sample/README.md index 521c206..93cf8b3 100644 --- a/Assets/YooAsset/Samples~/UniTask Sample/README.md +++ b/Assets/YooAsset/Samples~/UniTask Sample/README.md @@ -1,9 +1,6 @@ # UniTask 扩展 -[仓库链接](https://github.com/Cysharp/UniTask) -- 请去下载对应的源码,并删除此目录最后的波浪线 -- 在项目的 `asmdef` 文件中添加对 `UniTask.YooAsset` 的引用 -- 在 UniTask `_InternalVisibleTo.cs` 文件中增加 `[assembly: InternalsVisibleTo("UniTask.YooAsset")]` 后即可使用 +这里为了照顾新手使用,做了一些妥协,有定制需求的需要手动调整一下 ## 代码示例 @@ -20,4 +17,22 @@ public async UniTask Example(IProgress progress = null, PlayerLoopTiming go.transform.localPosition = Vector3.zero; go.transform.localScale = Vector3.one; } -``` \ No newline at end of file +``` + +## 初学者教程 + +**如果你弄不明白 asmdef 文件到底是啥,就按照下发内容操作** + +- 将 `Samples/UniTask Sample/UniTask` 文件夹拷入游戏中 +- 如果项目有 `asmdef`,则引用 `UniTask` 和 `YooAsset`,如果没有,就不用关心这一步 + + +## 项目定制教程 + +- 请去下载 [UniTask](https://github.com/Cysharp/UniTask) 源码 + - 注意不要用 `Sample` 里面的 `UniTask` 这个是专门给新手定制的 +- 将 `Samples/UniTask Sample/UniTask/Runtime/External/YooAsset` 文件夹拷贝到 `UniTask/Runtime/External/YooAsset` 中 +- 创建 `UniTask.YooAsset.asmdef` 文件 +- 添加 `UniTask` 和 `YooAsset` 的引用 +- 在 UniTask `_InternalVisibleTo.cs` 文件中增加 `[assembly: InternalsVisibleTo("UniTask.YooAsset")]` 后即可使用 + diff --git a/Assets/YooAsset/Samples~/UniTask Sample/UniTask.YooAsset.asmdef b/Assets/YooAsset/Samples~/UniTask Sample/UniTask.YooAsset.asmdef deleted file mode 100644 index 8fc6583..0000000 --- a/Assets/YooAsset/Samples~/UniTask Sample/UniTask.YooAsset.asmdef +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "UniTask.YooAsset", - "rootNamespace": "", - "references": [ - "GUID:e34a5702dd353724aa315fb8011f08c3", - "GUID:f51ebe6a0ceec4240a699833d6309b23" - ], - "includePlatforms": [], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": false, - "precompiledReferences": [], - "autoReferenced": true, - "defineConstraints": [], - "versionDefines": [], - "noEngineReferences": false -} \ No newline at end of file diff --git a/Assets/YooAsset/Samples~/UniTask Sample/UniTask/Runtime/External/YooAsset.meta b/Assets/YooAsset/Samples~/UniTask Sample/UniTask/Runtime/External/YooAsset.meta new file mode 100644 index 0000000..3d9fada --- /dev/null +++ b/Assets/YooAsset/Samples~/UniTask Sample/UniTask/Runtime/External/YooAsset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8a55ef7d1bba14cc982b478d482c4461 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/YooAsset/Samples~/UniTask Sample/AsyncOperationBaseExtensions.cs b/Assets/YooAsset/Samples~/UniTask Sample/UniTask/Runtime/External/YooAsset/AsyncOperationBaseExtensions.cs similarity index 100% rename from Assets/YooAsset/Samples~/UniTask Sample/AsyncOperationBaseExtensions.cs rename to Assets/YooAsset/Samples~/UniTask Sample/UniTask/Runtime/External/YooAsset/AsyncOperationBaseExtensions.cs diff --git a/Assets/YooAsset/Samples~/UniTask Sample/AsyncOperationBaseExtensions.cs.meta b/Assets/YooAsset/Samples~/UniTask Sample/UniTask/Runtime/External/YooAsset/AsyncOperationBaseExtensions.cs.meta similarity index 100% rename from Assets/YooAsset/Samples~/UniTask Sample/AsyncOperationBaseExtensions.cs.meta rename to Assets/YooAsset/Samples~/UniTask Sample/UniTask/Runtime/External/YooAsset/AsyncOperationBaseExtensions.cs.meta diff --git a/Assets/YooAsset/Samples~/UniTask Sample/OperationHandleBaseExtensions.cs b/Assets/YooAsset/Samples~/UniTask Sample/UniTask/Runtime/External/YooAsset/OperationHandleBaseExtensions.cs similarity index 100% rename from Assets/YooAsset/Samples~/UniTask Sample/OperationHandleBaseExtensions.cs rename to Assets/YooAsset/Samples~/UniTask Sample/UniTask/Runtime/External/YooAsset/OperationHandleBaseExtensions.cs diff --git a/Assets/YooAsset/Samples~/UniTask Sample/OperationHandleBaseExtensions.cs.meta b/Assets/YooAsset/Samples~/UniTask Sample/UniTask/Runtime/External/YooAsset/OperationHandleBaseExtensions.cs.meta similarity index 100% rename from Assets/YooAsset/Samples~/UniTask Sample/OperationHandleBaseExtensions.cs.meta rename to Assets/YooAsset/Samples~/UniTask Sample/UniTask/Runtime/External/YooAsset/OperationHandleBaseExtensions.cs.meta diff --git a/Assets/YooAsset/Samples~/UniTask Sample/UniTask/Runtime/UniTask.asmdef b/Assets/YooAsset/Samples~/UniTask Sample/UniTask/Runtime/UniTask.asmdef index a5c594d..53beec1 100644 --- a/Assets/YooAsset/Samples~/UniTask Sample/UniTask/Runtime/UniTask.asmdef +++ b/Assets/YooAsset/Samples~/UniTask Sample/UniTask/Runtime/UniTask.asmdef @@ -1,7 +1,9 @@ { "name": "UniTask", "rootNamespace": "", - "references": [], + "references": [ + "GUID:e34a5702dd353724aa315fb8011f08c3" + ], "includePlatforms": [], "excludePlatforms": [], "allowUnsafeCode": false,