From 06f2998ed8fcd05c9e1acbf16dd99ce9c8fb3adc Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期三, 11 二月 2026 11:07:09 +0800
Subject: [PATCH] h5 资源系统改造
---
Assets/Plugins/YooAsset.UniTask/UniTaskRef.meta | 8
Assets/AssetBundleCollectorSetting.asset | 143 +++++
Assets/Launch/Manager/LocalResManager.cs | 128 ++++
Assets/Launch/Common/IYooAssetBridge.cs.meta | 11
Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/OperationHandleBaseExtensions.cs.meta | 3
Assets/Plugins/YooAsset.UniTask.meta | 8
Assets/Plugins/YooAsset.UniTask/Runtime/External.meta | 8
Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/OperationHandleBaseExtensions.cs | 221 +++++++++
Assets/Launch/Common/IYooAssetBridge.cs | 82 +++
Assets/Launch/UI/LaunchWins/LaunchExWin.cs | 51 ++
Assets/Plugins/YooAsset.MiniGame/README.md.meta | 7
Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/AsyncOperationBaseExtensions.cs | 125 +++++
Assets/Plugins/YooAsset.UniTask/UniTaskRef/UniTaskRef.asmref.meta | 7
Assets/Launch/Launch.cs | 46 +
Assets/Launch/Manager/YooAssetInitializer.cs.meta | 11
Assets/Plugins/YooAsset.UniTask/UniTaskRef/_InternalVisibleTo.cs.meta | 11
Assets/Editor/YooAsset.meta | 8
Assets/Editor/YooAsset/AddressByRelativePath.cs.meta | 11
Assets/Plugins/YooAsset.UniTask/UniTaskRef/_InternalVisibleTo.cs | 3
Assets/Editor/YooAsset/AddressByRelativePath.cs | 43 +
Assets/Launch/Manager/YooAssetInitializer.cs | 403 ++++++++++++++++
Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/AsyncOperationBaseExtensions.cs.meta | 3
Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/UniTask.YooAsset.asmdef | 23
Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset.meta | 8
Assets/Plugins/YooAsset.UniTask/UniTaskRef/UniTaskRef.asmref | 3
Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/UniTask.YooAsset.asmdef.meta | 7
Assets/Plugins/YooAsset.MiniGame/README.md | 31 +
Assets/Plugins/YooAsset.UniTask/Runtime.meta | 8
Assets/Plugins/YooAsset.MiniGame.meta | 8
29 files changed, 1,411 insertions(+), 18 deletions(-)
diff --git a/Assets/AssetBundleCollectorSetting.asset b/Assets/AssetBundleCollectorSetting.asset
index fd479e2..ee8bf94 100644
--- a/Assets/AssetBundleCollectorSetting.asset
+++ b/Assets/AssetBundleCollectorSetting.asset
@@ -38,6 +38,43 @@
FilterRuleName: CollectAll
AssetTags:
UserData:
+ - CollectPath: Assets/ResourcesOut/UIComp
+ CollectorGUID: cafb96babf67f0e47aa47d7bd7e851f9
+ CollectorType: 0
+ AddressRuleName: AddressByFolderAndFileName
+ PackRuleName: PackDirectory
+ FilterRuleName: CollectAll
+ AssetTags:
+ UserData:
+ - CollectPath: Assets/ResourcesOut/Sprite
+ CollectorGUID: d525c1ea56911ef46968923700fee47f
+ CollectorType: 0
+ AddressRuleName: AddressByFolderAndFileName
+ PackRuleName: PackDirectory
+ FilterRuleName: CollectAll
+ AssetTags:
+ UserData:
+ - CollectPath: Assets/ResourcesOut/Texture
+ CollectorGUID: cc4265f3ee528e64e8afa76bd8f7d3f7
+ CollectorType: 0
+ AddressRuleName: AddressByFolderAndFileName
+ PackRuleName: PackDirectory
+ FilterRuleName: CollectAll
+ AssetTags:
+ UserData:
+ - GroupName: Font
+ GroupDesc:
+ AssetTags:
+ ActiveRuleName: EnableGroup
+ Collectors:
+ - CollectPath: Assets/ResourcesOut/Font
+ CollectorGUID: 6c72fee81b7c8804dbc80d80a5770197
+ CollectorType: 0
+ AddressRuleName: AddressByRelativePath
+ PackRuleName: PackDirectory
+ FilterRuleName: CollectAll
+ AssetTags:
+ UserData:
- PackageName: Prefab
PackageDesc: all prefab
EnableAddressable: 1
@@ -52,8 +89,48 @@
AssetTags:
ActiveRuleName: EnableGroup
Collectors:
- - CollectPath: Assets/ResourcesOut/Prefab
- CollectorGUID: 84f0993784b8e8d41a68d0e1e2be57bd
+ - CollectPath: Assets/ResourcesOut/BuiltIn
+ CollectorGUID: e5f9df9a324df2b46b1a92fa8da26b67
+ CollectorType: 0
+ AddressRuleName: AddressByRelativePath
+ PackRuleName: PackDirectory
+ FilterRuleName: CollectAll
+ AssetTags:
+ UserData:
+ - CollectPath: Assets/ResourcesOut/Shader
+ CollectorGUID: 01ad80e2bb073fb46ad906e3572fbe50
+ CollectorType: 0
+ AddressRuleName: AddressByRelativePath
+ PackRuleName: PackDirectory
+ FilterRuleName: CollectAll
+ AssetTags:
+ UserData:
+ - CollectPath: Assets/ResourcesOut/Materials
+ CollectorGUID: 676c8b4532d6ca646804bf73ed43dd96
+ CollectorType: 0
+ AddressRuleName: AddressByFolderAndFileName
+ PackRuleName: PackDirectory
+ FilterRuleName: CollectAll
+ AssetTags:
+ UserData:
+ - CollectPath: Assets/ResourcesOut/ScriptableObject
+ CollectorGUID: 1482db32e9d88d444bc22e54075bf994
+ CollectorType: 0
+ AddressRuleName: AddressByFolderAndFileName
+ PackRuleName: PackDirectory
+ FilterRuleName: CollectAll
+ AssetTags:
+ UserData:
+ - CollectPath: Assets/ResourcesOut/Scenes
+ CollectorGUID: b3332ee13576c994186d5570af59b0b6
+ CollectorType: 0
+ AddressRuleName: AddressByFolderAndFileName
+ PackRuleName: PackDirectory
+ FilterRuleName: CollectAll
+ AssetTags:
+ UserData:
+ - CollectPath: Assets/ResourcesOut/Config
+ CollectorGUID: 6a0e1d814ea59174985b17c9f4ecaba3
CollectorType: 0
AddressRuleName: AddressByFolderAndFileName
PackRuleName: PackDirectory
@@ -76,10 +153,10 @@
Collectors: []
- PackageName: UIEffect
PackageDesc:
- EnableAddressable: 0
+ EnableAddressable: 1
SupportExtensionless: 1
LocationToLower: 0
- IncludeAssetGUID: 0
+ IncludeAssetGUID: 1
AutoCollectShaders: 1
IgnoreRuleName: NormalIgnoreRule
Groups:
@@ -88,10 +165,62 @@
AssetTags:
ActiveRuleName: EnableGroup
Collectors:
- - CollectPath: Assets/ResourcesOut/Effect
- CollectorGUID: 63ddc4df56ae98b4cbc48f45628a26a7
+ - CollectPath: Assets/ResourcesOut/UIEffect
+ CollectorGUID: 62eb3abc624381e4b8950f355812a8e9
CollectorType: 0
- AddressRuleName: AddressByFileName
+ AddressRuleName: AddressByFolderAndFileName
+ PackRuleName: PackDirectory
+ FilterRuleName: CollectAll
+ AssetTags:
+ UserData:
+ - PackageName: Battle
+ PackageDesc: battle resources
+ EnableAddressable: 1
+ SupportExtensionless: 1
+ LocationToLower: 0
+ IncludeAssetGUID: 1
+ AutoCollectShaders: 1
+ IgnoreRuleName: NormalIgnoreRule
+ Groups:
+ - GroupName: Prefab
+ GroupDesc:
+ AssetTags:
+ ActiveRuleName: EnableGroup
+ Collectors:
+ - CollectPath: Assets/ResourcesOut/Hero
+ CollectorGUID: 4ef1d5e33efbd83438f79bd2fd7c44ac
+ CollectorType: 0
+ AddressRuleName: AddressByFolderAndFileName
+ PackRuleName: PackDirectory
+ FilterRuleName: CollectAll
+ AssetTags:
+ UserData:
+ - CollectPath: Assets/ResourcesOut/Battle
+ CollectorGUID: f4b5330ed101c7b4c8cbfba3f0daff9f
+ CollectorType: 0
+ AddressRuleName: AddressByFolderAndFileName
+ PackRuleName: PackDirectory
+ FilterRuleName: CollectAll
+ AssetTags:
+ UserData:
+ - PackageName: Audio
+ PackageDesc: audio resources
+ EnableAddressable: 1
+ SupportExtensionless: 1
+ LocationToLower: 0
+ IncludeAssetGUID: 1
+ AutoCollectShaders: 1
+ IgnoreRuleName: NormalIgnoreRule
+ Groups:
+ - GroupName: Prefab
+ GroupDesc:
+ AssetTags:
+ ActiveRuleName: EnableGroup
+ Collectors:
+ - CollectPath: Assets/ResourcesOut/Audio
+ CollectorGUID: 3d2c92bf721b286489d290a1a2c9763a
+ CollectorType: 0
+ AddressRuleName: AddressByRelativePath
PackRuleName: PackDirectory
FilterRuleName: CollectAll
AssetTags:
diff --git a/Assets/Editor/YooAsset.meta b/Assets/Editor/YooAsset.meta
new file mode 100644
index 0000000..852e0b1
--- /dev/null
+++ b/Assets/Editor/YooAsset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 5357a95619b07614a93e905607cd4533
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Editor/YooAsset/AddressByRelativePath.cs b/Assets/Editor/YooAsset/AddressByRelativePath.cs
new file mode 100644
index 0000000..863311f
--- /dev/null
+++ b/Assets/Editor/YooAsset/AddressByRelativePath.cs
@@ -0,0 +1,43 @@
+// ============================================================================
+// AddressByRelativePath.cs 鈥� 鑷畾涔� YooAsset 鍦板潃瑙勫垯
+// 浣跨敤鐩稿浜� CollectPath 鐨勫畬鏁磋矾寰勶紙涓嶅惈鎵╁睍鍚嶏級浣滀负鍦板潃
+// 瑙e喅鍚� Package 鍐呬笉鍚屽瓙鐩綍涓嬪悓鍚嶆枃浠剁殑鍦板潃鍐茬獊
+// ============================================================================
+
+using System.IO;
+using YooAsset.Editor;
+
+/// <summary>
+/// 瀹氫綅鍦板潃 = 璧勬簮鐩稿浜庢敹闆嗙洰褰曠殑璺緞锛堜笉鍚墿灞曞悕锛夈��
+/// 渚嬪 CollectPath = "Assets/ResourcesOut/Audio"
+/// AssetPath = "Assets/ResourcesOut/Audio/Battle/Effect/boom.wav"
+/// 鈫� 鍦板潃 = "Battle/Effect/boom"
+/// </summary>
+[DisplayName("瀹氫綅鍦板潃: 鐩稿璺緞")]
+public class AddressByRelativePath : IAddressRule
+{
+ string IAddressRule.GetAssetAddress(AddressRuleData data)
+ {
+ // 鍘绘帀 CollectPath 鍓嶇紑锛屽緱鍒扮浉瀵硅矾寰�
+ string relativePath = data.AssetPath;
+ string collectRoot = data.CollectPath;
+
+ // 纭繚浠� / 缁撳熬
+ if (!collectRoot.EndsWith("/"))
+ collectRoot += "/";
+
+ if (relativePath.StartsWith(collectRoot))
+ {
+ relativePath = relativePath.Substring(collectRoot.Length);
+ }
+
+ // 鍘绘帀鎵╁睍鍚�
+ string ext = Path.GetExtension(relativePath);
+ if (!string.IsNullOrEmpty(ext))
+ {
+ relativePath = relativePath.Substring(0, relativePath.Length - ext.Length);
+ }
+
+ return relativePath;
+ }
+}
diff --git a/Assets/Editor/YooAsset/AddressByRelativePath.cs.meta b/Assets/Editor/YooAsset/AddressByRelativePath.cs.meta
new file mode 100644
index 0000000..2f889f6
--- /dev/null
+++ b/Assets/Editor/YooAsset/AddressByRelativePath.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b86b10bad08b3244ab4a912f2c8bdff7
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Launch/Common/IYooAssetBridge.cs b/Assets/Launch/Common/IYooAssetBridge.cs
new file mode 100644
index 0000000..422f638
--- /dev/null
+++ b/Assets/Launch/Common/IYooAssetBridge.cs
@@ -0,0 +1,82 @@
+// ============================================================================
+// IYooAssetBridge.cs 鈥� 璺ㄧ▼搴忛泦璧勬簮鍔犺浇妗ユ帴鎺ュ彛
+// 瀹氫箟鍦� Launch 绋嬪簭闆嗕腑锛岀敱 Main 绋嬪簭闆嗕腑鐨� YooAssetService 瀹炵幇
+// ============================================================================
+
+using Cysharp.Threading.Tasks;
+using UnityEngine;
+
+namespace ProjSG.Resource
+{
+ /// <summary>
+ /// 璺ㄧ▼搴忛泦璧勬簮鍔犺浇妗ユ帴鎺ュ彛銆�
+ /// 瀹氫箟鍦� Launch 绋嬪簭闆嗕腑锛屽厑璁� Launch 浠g爜鍦� Main 鐑洿 DLL 鍔犺浇鍚�
+ /// 閫氳繃璇ユ帴鍙d娇鐢� Main 涓疄鐜扮殑瀹屾暣 YooAsset 灏佽銆�
+ /// </summary>
+ public interface IYooAssetBridge
+ {
+ /// <summary>
+ /// 妗ユ帴鏄惁宸叉敞鍐岋紙Main 绋嬪簭闆嗗凡鍔犺浇骞舵敞鍐屽疄鐜帮級
+ /// </summary>
+ bool IsRegistered { get; }
+
+ /// <summary>
+ /// 寮傛鍔犺浇璧勬簮銆�
+ /// </summary>
+ /// <typeparam name="T">璧勬簮绫诲瀷</typeparam>
+ /// <param name="location">YooAsset 璧勬簮鍦板潃</param>
+ /// <returns>鍔犺浇瀹屾垚鐨勮祫婧愬璞�</returns>
+ UniTask<T> LoadAssetAsync<T>(string location) where T : UnityEngine.Object;
+
+ /// <summary>
+ /// 寮傛鍔犺浇鍘熷鏂囨湰鏂囦欢銆�
+ /// </summary>
+ /// <param name="location">YooAsset 璧勬簮鍦板潃</param>
+ /// <returns>鏂囦欢鏂囨湰鍐呭</returns>
+ UniTask<string> LoadRawFileTextAsync(string location);
+
+ /// <summary>
+ /// 寮傛鍔犺浇鍘熷浜岃繘鍒舵枃浠躲��
+ /// </summary>
+ UniTask<byte[]> LoadRawFileBytesAsync(string location);
+
+ /// <summary>
+ /// 鎵归噺棰勫姞杞借祫婧愩��
+ /// </summary>
+ /// <param name="locations">璧勬簮鍦板潃鍒楄〃</param>
+ UniTask PreloadAsync(string[] locations);
+
+ /// <summary>
+ /// 鍚屾鑾峰彇宸茬紦瀛樼殑璧勬簮銆�
+ /// 浠呭湪璧勬簮宸查鍔犺浇鍚庡彲鐢紝鍚﹀垯杩斿洖 null銆�
+ /// </summary>
+ T GetCached<T>(string location) where T : UnityEngine.Object;
+ }
+
+ /// <summary>
+ /// IYooAssetBridge 鐨勫叏灞�娉ㄥ唽鐐广��
+ /// Launch 绋嬪簭闆嗛�氳繃姝ら潤鎬佺被璁块棶 Main 娉ㄥ唽鐨勬ˉ鎺ュ疄鐜般��
+ /// </summary>
+ public static class YooAssetBridgeHolder
+ {
+ private static IYooAssetBridge _instance;
+
+ /// <summary>
+ /// 鑾峰彇宸叉敞鍐岀殑妗ユ帴瀹炰緥銆�
+ /// </summary>
+ public static IYooAssetBridge Instance => _instance;
+
+ /// <summary>
+ /// 娉ㄥ唽妗ユ帴瀹炵幇锛堢敱 Main 绋嬪簭闆嗗湪鍒濆鍖栨椂璋冪敤锛夈��
+ /// </summary>
+ public static void Register(IYooAssetBridge bridge)
+ {
+ _instance = bridge;
+ }
+
+ /// <summary>
+ /// 妗ユ帴鏄惁宸叉敞鍐屻��
+ /// </summary>
+ public static bool IsRegistered => _instance != null && _instance.IsRegistered;
+ }
+}
diff --git a/Assets/Launch/Common/IYooAssetBridge.cs.meta b/Assets/Launch/Common/IYooAssetBridge.cs.meta
new file mode 100644
index 0000000..a161070
--- /dev/null
+++ b/Assets/Launch/Common/IYooAssetBridge.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: f1ec0c19dc4344d4da9da6e52850e783
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Launch/Launch.cs b/Assets/Launch/Launch.cs
index 70c331b..045c506 100644
--- a/Assets/Launch/Launch.cs
+++ b/Assets/Launch/Launch.cs
@@ -11,6 +11,7 @@
using UnityEngine.Networking;
using LaunchCommon;
using HybridCLR;
+using YooAsset;
public class Launch : MonoBehaviour
{
@@ -51,7 +52,7 @@
m_Instance = this;
-#if !UNITY_EDITOR
+#if !UNITY_EDITOR && !UNITY_WEBGL
if (File.Exists(Directory.GetParent(Application.persistentDataPath) + "/Debug") ||
LocalSave.GetString("#@#BrancH") != string.Empty)
{
@@ -72,9 +73,48 @@
Debug.Log("Launch Start");
InitPlugins();
+
+ // 1. 灏芥棭鍒濆鍖� YooAsset锛岀‘淇� LocalResManager 鍔犺浇璧勬簮鏃跺彲浣跨敤 YooAsset
+ await InitYooAssetEarlyAsync();
+
InitSetting();
// 1. 鎵撳紑鍔犺浇鐣岄潰
+ }
+
+ /// <summary>
+ /// 鍦� Launch 闃舵灏芥棭鍒濆鍖� YooAsset銆�
+ /// 瀹屾垚鍚� LocalResManager.LoadSprite/LoadBuiltInPrefab 灏嗛�氳繃 YooAsset 鍔犺浇璧勬簮銆�
+ /// </summary>
+ private async UniTask InitYooAssetEarlyAsync()
+ {
+ try
+ {
+#if UNITY_EDITOR
+ var playMode = EPlayMode.EditorSimulateMode;
+#elif UNITY_WEBGL
+ var playMode = EPlayMode.WebPlayMode;
+#else
+ var playMode = EPlayMode.OfflinePlayMode;
+#endif
+ Debug.Log($"[Launch] Initializing YooAsset early with PlayMode={playMode}");
+ await YooAssetInitializer.Instance.InitializeAsync(playMode);
+
+ if (YooAssetInitializer.Instance.State == YooAssetInitializer.InitState.InitFailed)
+ {
+ Debug.LogError($"[Launch] YooAsset early init failed: {YooAssetInitializer.Instance.LastError}");
+ return;
+ }
+
+ // EditorSimulateMode 鍜� OfflinePlayMode 涓嶉渶瑕佽繙绋嬬増鏈鐞嗭紝
+ // 鐩存帴鏍囪涓� Ready
+ await YooAssetInitializer.Instance.RequestVersionAndUpdateAsync();
+ Debug.Log("[Launch] YooAsset early init completed. State: " + YooAssetInitializer.Instance.State);
+ }
+ catch (Exception ex)
+ {
+ Debug.LogError($"[Launch] YooAsset early init exception: {ex}");
+ }
}
private void InitSetting()
@@ -203,6 +243,10 @@
DownLoadAndDiscompressTask.Destroy();
}
+ // YooAssetInitializer 涓嶅湪姝ゅ閿�姣� 鈥斺�� 鍏� DefaultPackage 闇�瑕佷繚鐣�
+ // 渚� Main 绋嬪簭闆嗕腑 YooAssetService 鎺ョ浣跨敤锛堥�氳繃 IYooAssetBridge锛�
+ // YooAssetInitializer 鐨� Release 鐢� YooAssetService 鍒濆鍖栨椂鍐冲畾
+
if (null != launchExWin)
{
Destroy(launchExWin);
diff --git a/Assets/Launch/Manager/LocalResManager.cs b/Assets/Launch/Manager/LocalResManager.cs
index e7c7f41..acfabcb 100644
--- a/Assets/Launch/Manager/LocalResManager.cs
+++ b/Assets/Launch/Manager/LocalResManager.cs
@@ -3,10 +3,12 @@
using System.Collections.Generic;
using Cysharp.Threading.Tasks;
using System;
+using System.Threading;
using UnityEngine.U2D;
using LitJson;
using System.IO;
using UnityEngine.Networking;
+using YooAsset;
#if UNITY_EDITOR
using UnityEditor;
@@ -137,9 +139,18 @@
}
}
+ [Obsolete("Legacy AB loading 鈥� use YooAsset via YooAssetInitializer")]
private AssetBundle spriteBundle = null; //闇�瑕佸嵏杞�
+ [Obsolete("Legacy AB loading 鈥� use YooAsset via YooAssetInitializer")]
private AssetBundle prefabBundle = null; //闇�瑕佸嵏杞�
private SpriteAtlas spriteAtlas = null;
+
+ /// <summary>
+ /// YooAsset 鏄惁宸插氨缁紙鐢� YooAssetInitializer 鍒濆鍖栵級
+ /// </summary>
+ private bool IsYooAssetReady => YooAssetInitializer.IsValid()
+ && YooAssetInitializer.Instance.State == YooAssetInitializer.InitState.Ready
+ && YooAssetInitializer.Instance.DefaultPackage != null;
public void Init()
{
@@ -152,6 +163,7 @@
}
var parentDirectory = Directory.GetParent(Application.persistentDataPath);
+#if !UNITY_WEBGL
if (File.Exists(parentDirectory + "/Debug"))
{
var content = File.ReadAllText(parentDirectory + "/Debug");
@@ -161,6 +173,7 @@
debugBranch = json.branch;
}
}
+#endif
Clock.Init();
Debug.Log("LocalResManager.Init");
@@ -168,8 +181,10 @@
public void Release()
{
+#pragma warning disable CS0612, CS0618 // Suppress obsolete warnings for legacy cleanup
spriteBundle?.Unload(true); //true瀹屽叏鍗歌浇锛屾洿鏂板悗閲嶆柊鍔犺浇
prefabBundle?.Unload(true);
+#pragma warning restore CS0612, CS0618
assetVersions = null;
localAssetVersions = null;
spriteAtlas = null;
@@ -237,6 +252,10 @@
return path;
}
+ /// <summary>
+ /// 鍚屾鍔犺浇 Sprite銆�
+ /// 浼樺厛浣跨敤 YooAsset锛堣嫢宸插垵濮嬪寲锛夛紝鍚﹀垯鍥為��鍒颁紶缁� AssetBundle 鍔犺浇銆�
+ /// </summary>
public Sprite LoadSprite(string name)
{
Sprite sprite = null;
@@ -251,15 +270,22 @@
var spriteAtlas = UnityEditor.AssetDatabase.LoadAssetAtPath<SpriteAtlas>("Assets/ResourcesOut/BuiltIn/Sprites/sprites.spriteatlasv2");
sprite = spriteAtlas.GetSprite(name);
}
-
#else
- if (spriteBundle == null)
+ if (IsYooAssetReady)
{
- string _path = GetAssetFilePath("builtin/sprites");
- spriteBundle = AssetBundle.LoadFromFile(_path);
+ var handle = YooAssetInitializer.Instance.DefaultPackage.LoadAssetSync<Sprite>(name);
+ sprite = handle.AssetObject as Sprite;
}
-
- sprite = spriteBundle.LoadAsset(name, typeof(Sprite)) as Sprite;
+ else
+ {
+ // Legacy fallback 鈥� AssetBundle.LoadFromFile
+ if (spriteBundle == null)
+ {
+ string _path = GetAssetFilePath("builtin/sprites");
+ spriteBundle = AssetBundle.LoadFromFile(_path);
+ }
+ sprite = spriteBundle.LoadAsset(name, typeof(Sprite)) as Sprite;
+ }
#endif
if (sprite == null)
{
@@ -269,6 +295,49 @@
return sprite;
}
+ /// <summary>
+ /// 寮傛鍔犺浇 Sprite锛圵ebGL 鍏煎锛夈��
+ /// 浣跨敤 YooAsset 寮傛鍔犺浇 API锛岄�傜敤浜庢墍鏈夊钩鍙般��
+ /// </summary>
+ public async UniTask<Sprite> LoadSpriteAsync(string name, CancellationToken cancellationToken = default)
+ {
+ Sprite sprite = null;
+#if UNITY_EDITOR
+ if (excludePngs.Contains(StringUtility.Concat(name, ".png")))
+ {
+ var path = StringUtility.Concat("Assets/ResourcesOut/BuiltIn/Sprites/", name, ".png");
+ sprite = UnityEditor.AssetDatabase.LoadAssetAtPath<Sprite>(path);
+ }
+ else
+ {
+ var atlas = UnityEditor.AssetDatabase.LoadAssetAtPath<SpriteAtlas>("Assets/ResourcesOut/BuiltIn/Sprites/sprites.spriteatlasv2");
+ sprite = atlas.GetSprite(name);
+ }
+#else
+ if (IsYooAssetReady)
+ {
+ var handle = YooAssetInitializer.Instance.DefaultPackage.LoadAssetAsync<Sprite>(name);
+ await handle.ToUniTask(cancellationToken: cancellationToken);
+ sprite = handle.AssetObject as Sprite;
+ }
+ else
+ {
+ // Fallback to sync if YooAsset not ready (should not happen in normal flow)
+ Debug.LogWarning($"[LocalResManager] LoadSpriteAsync: YooAsset not ready, falling back to sync for '{name}'");
+ sprite = LoadSprite(name);
+ }
+#endif
+ if (sprite == null)
+ {
+ Debug.LogErrorFormat("LoadSpriteAsync() => 鍔犺浇涓嶅埌璧勬簮: {0}.", name);
+ }
+ return sprite;
+ }
+
+ /// <summary>
+ /// 鍚屾鍔犺浇鍐呯疆棰勫埗浣撱��
+ /// 浼樺厛浣跨敤 YooAsset锛堣嫢宸插垵濮嬪寲锛夛紝鍚﹀垯鍥為��鍒颁紶缁� AssetBundle 鍔犺浇銆�
+ /// </summary>
public GameObject LoadBuiltInPrefab(string name)
{
GameObject prefab = null;
@@ -276,12 +345,21 @@
var path = string.Concat("Assets/ResourcesOut/BuiltIn/Prefabs/", name, ".prefab");
prefab = UnityEditor.AssetDatabase.LoadAssetAtPath<GameObject>(path);
#else
- if (prefabBundle == null)
+ if (IsYooAssetReady)
{
- string _path = GetAssetFilePath("builtin/prefabs");
- prefabBundle = AssetBundle.LoadFromFile(_path);
+ var handle = YooAssetInitializer.Instance.DefaultPackage.LoadAssetSync<GameObject>(name);
+ prefab = handle.AssetObject as GameObject;
}
- prefab = prefabBundle.LoadAsset(name) as GameObject;
+ else
+ {
+ // Legacy fallback 鈥� AssetBundle.LoadFromFile
+ if (prefabBundle == null)
+ {
+ string _path = GetAssetFilePath("builtin/prefabs");
+ prefabBundle = AssetBundle.LoadFromFile(_path);
+ }
+ prefab = prefabBundle.LoadAsset(name) as GameObject;
+ }
#endif
if (prefab == null)
{
@@ -291,6 +369,36 @@
return prefab;
}
+ /// <summary>
+ /// 寮傛鍔犺浇鍐呯疆棰勫埗浣擄紙WebGL 鍏煎锛夈��
+ /// 浣跨敤 YooAsset 寮傛鍔犺浇 API锛岄�傜敤浜庢墍鏈夊钩鍙般��
+ /// </summary>
+ public async UniTask<GameObject> LoadBuiltInPrefabAsync(string name, CancellationToken cancellationToken = default)
+ {
+ GameObject prefab = null;
+#if UNITY_EDITOR
+ var path = string.Concat("Assets/ResourcesOut/BuiltIn/Prefabs/", name, ".prefab");
+ prefab = UnityEditor.AssetDatabase.LoadAssetAtPath<GameObject>(path);
+#else
+ if (IsYooAssetReady)
+ {
+ var handle = YooAssetInitializer.Instance.DefaultPackage.LoadAssetAsync<GameObject>(name);
+ await handle.ToUniTask(cancellationToken: cancellationToken);
+ prefab = handle.AssetObject as GameObject;
+ }
+ else
+ {
+ Debug.LogWarning($"[LocalResManager] LoadBuiltInPrefabAsync: YooAsset not ready, falling back to sync for '{name}'");
+ prefab = LoadBuiltInPrefab(name);
+ }
+#endif
+ if (prefab == null)
+ {
+ Debug.LogErrorFormat("LoadBuiltInPrefabAsync() => 鍔犺浇涓嶅埌璧勬簮: {0}.", name);
+ }
+ return prefab;
+ }
+
static Dictionary<string, string> languageShowDict = new Dictionary<string, string>();//灏勪腑鏄剧ず鐨勫璇█鐗堟湰
Dictionary<string, string> languageDict = new Dictionary<string, string>();// unity璇█閰嶇疆瀵瑰簲鐨勭害瀹氬瓧绗�
diff --git a/Assets/Launch/Manager/YooAssetInitializer.cs b/Assets/Launch/Manager/YooAssetInitializer.cs
new file mode 100644
index 0000000..0fa373c
--- /dev/null
+++ b/Assets/Launch/Manager/YooAssetInitializer.cs
@@ -0,0 +1,403 @@
+// ============================================================================
+// YooAssetInitializer.cs 鈥� Launch 闃舵 YooAsset 鍒濆鍖栧櫒
+// 鍦� Launch AOT 绋嬪簭闆嗕腑鎵ц YooAsset 鐨勫寘瑁瑰垱寤恒�佺増鏈姹備笌 Manifest 鏇存柊
+// 鏀寔 EditorSimulateMode / HostPlayMode / OfflinePlayMode / WebPlayMode
+// 鏀寔澶� Package 骞惰鍒濆鍖�
+// ============================================================================
+
+using System;
+using System.Collections.Generic;
+using Cysharp.Threading.Tasks;
+using UnityEngine;
+using YooAsset;
+
+/// <summary>
+/// Launch 闃舵璐熻矗 YooAsset 璧勬簮绯荤粺鐨勬棭鏈熷垵濮嬪寲銆�
+/// 瀹屾垚 ResourcePackage 鐨勫垱寤恒�佸垵濮嬪寲鍙傛暟閰嶇疆銆佺増鏈姹備笌 Manifest 鏇存柊銆�
+/// 鏀寔澶� Package 鍒濆鍖栵紝鍖呭悕椤讳笌 AssetBundleCollectorSetting 涓�鑷淬��
+/// </summary>
+public class YooAssetInitializer : Singleton<YooAssetInitializer>
+{
+ /// <summary>
+ /// 鍒濆鍖栫姸鎬�
+ /// </summary>
+ public enum InitState
+ {
+ Uninitialized,
+ Initializing,
+ Initialized,
+ VersionChecked,
+ Ready,
+ InitFailed,
+ VersionFailed,
+ }
+
+ // ====================================================================
+ // Package 鍚嶇О甯搁噺 鈥� 蹇呴』涓� AssetBundleCollectorSetting.asset 涓�鑷�
+ // Launch 绋嬪簭闆嗘棤娉曞紩鐢� Main 鐨� YooAssetPackageConfig锛屽湪姝ら噸澶嶅畾涔�
+ // ====================================================================
+
+ /// <summary>榛樿鍖呭悕 鈥� Prefab 鍖呭惈鍚姩蹇呴渶璧勬簮</summary>
+ public const string DEFAULT_PACKAGE_NAME = "Prefab";
+
+ /// <summary>
+ /// Launch 闃舵闇�瑕佸垵濮嬪寲鐨勫寘鍚嶏紙涓� Collector 涓�鑷达級銆�
+ /// </summary>
+ private static readonly string[] LAUNCH_PACKAGES = new[] { "Prefab", "UI", "UIEffect", "Battle", "Audio" };
+
+ private EPlayMode _playMode;
+ private IRemoteServices _remoteServices;
+ private ResourcePackage _defaultPackage;
+ private readonly Dictionary<string, ResourcePackage> _packages = new Dictionary<string, ResourcePackage>();
+
+ /// <summary>
+ /// 褰撳墠鍒濆鍖栫姸鎬�
+ /// </summary>
+ public InitState State { get; private set; } = InitState.Uninitialized;
+
+ /// <summary>
+ /// 鏈�鍚庝竴娆¢敊璇俊鎭�
+ /// </summary>
+ public string LastError { get; private set; }
+
+ /// <summary>
+ /// 鑾峰彇宸插垵濮嬪寲鐨勯粯璁ゅ寘瑁癸紙鍚戝悗鍏煎 LocalResManager锛�
+ /// </summary>
+ public ResourcePackage DefaultPackage => _defaultPackage;
+
+ /// <summary>
+ /// 褰撳墠杩愯妯″紡
+ /// </summary>
+ public EPlayMode PlayMode => _playMode;
+
+ /// <summary>
+ /// 鑾峰彇鎸囧畾鍚嶇О鐨勫凡鍒濆鍖栧寘瑁癸紝鎵句笉鍒拌繑鍥� null
+ /// </summary>
+ public ResourcePackage GetPackage(string packageName)
+ {
+ _packages.TryGetValue(packageName, out var pkg);
+ return pkg;
+ }
+
+ /// <summary>
+ /// 鎵�鏈夊凡鎴愬姛鍒濆鍖栫殑鍖呭悕
+ /// </summary>
+ public IEnumerable<string> InitializedPackageNames => _packages.Keys;
+
+ // ====================================================================
+ // 鍒濆鍖�
+ // ====================================================================
+
+ /// <summary>
+ /// 鍒濆鍖� YooAsset锛屽垱寤哄苟鍒濆鍖栧涓� ResourcePackage銆�
+ /// </summary>
+ /// <param name="playMode">杩愯妯″紡锛圗ditorSimulateMode / HostPlayMode锛�</param>
+ /// <param name="remoteServices">CDN 杩滅▼鏈嶅姟鍦板潃閰嶇疆锛圚ostPlayMode 蹇呴渶锛�</param>
+ /// <param name="packageNames">瑕佸垵濮嬪寲鐨勫寘鍚嶅垪琛紝null 浣跨敤 LAUNCH_PACKAGES</param>
+ public async UniTask InitializeAsync(EPlayMode playMode = EPlayMode.HostPlayMode,
+ IRemoteServices remoteServices = null, string[] packageNames = null)
+ {
+ if (State != InitState.Uninitialized)
+ {
+ Debug.LogWarning($"[YooAssetInitializer] Invalid state for Initialize: {State}");
+ return;
+ }
+
+ State = InitState.Initializing;
+ _playMode = playMode;
+ _remoteServices = remoteServices;
+
+ var names = packageNames ?? LAUNCH_PACKAGES;
+ int successCount = 0;
+
+ try
+ {
+ // YooAsset 鍏ㄥ眬鍒濆鍖栵紙骞傜瓑锛�
+ YooAssets.Initialize();
+
+ foreach (var pkgName in names)
+ {
+ try
+ {
+ var package = YooAssets.CreatePackage(pkgName);
+ var initParams = CreateInitParameters(playMode, remoteServices, pkgName);
+
+ var initOp = package.InitializeAsync(initParams);
+ await initOp.ToUniTask();
+
+ if (initOp.Status != EOperationStatus.Succeed)
+ {
+ Debug.LogWarning($"[YooAssetInitializer] Package '{pkgName}' init failed: {initOp.Error}");
+ continue;
+ }
+
+ _packages[pkgName] = package;
+ successCount++;
+
+ // DEFAULT_PACKAGE_NAME 鎴栫涓�涓垚鍔熺殑鍖呬綔涓洪粯璁ゅ寘
+ if (_defaultPackage == null || pkgName == DEFAULT_PACKAGE_NAME)
+ {
+ _defaultPackage = package;
+ YooAssets.SetDefaultPackage(package);
+ }
+
+ Debug.Log($"[YooAssetInitializer] Package '{pkgName}' initialized.");
+ }
+ catch (Exception ex)
+ {
+ // EditorSimulateMode 涓嬪寘涓嶅湪 Collector 涓細鎶涘紓甯革紝璺宠繃鍗冲彲
+ Debug.LogWarning($"[YooAssetInitializer] Package '{pkgName}' init exception (skipped): {ex.Message}");
+ }
+ }
+
+ if (successCount == 0)
+ {
+ LastError = "No packages initialized successfully.";
+ State = InitState.InitFailed;
+ Debug.LogError($"[YooAssetInitializer] {LastError}");
+ return;
+ }
+
+ State = InitState.Initialized;
+ Debug.Log($"[YooAssetInitializer] Initialized {successCount}/{names.Length} packages with PlayMode={playMode}");
+ }
+ catch (Exception ex)
+ {
+ LastError = ex.Message;
+ State = InitState.InitFailed;
+ Debug.LogError($"[YooAssetInitializer] Initialize exception: {ex}");
+ }
+ }
+
+ // ====================================================================
+ // 鐗堟湰绠$悊
+ // ====================================================================
+
+ /// <summary>
+ /// 璇锋眰鏈�鏂扮増鏈彿骞舵洿鏂� Manifest锛堝鎵�鏈夊凡鍒濆鍖栫殑鍖呰9锛夈��
+ /// 浠呭湪 HostPlayMode 涓嬫湁鎰忎箟锛孍ditorSimulateMode / OfflinePlayMode 涓嬭烦杩囥��
+ /// </summary>
+ public async UniTask RequestVersionAndUpdateAsync()
+ {
+ if (State != InitState.Initialized)
+ {
+ Debug.LogWarning($"[YooAssetInitializer] Invalid state for RequestVersionAndUpdate: {State}");
+ return;
+ }
+
+ // EditorSimulateMode / OfflinePlayMode 涓嶉渶瑕佽繙绋嬬増鏈鐞�
+ if (_playMode == EPlayMode.EditorSimulateMode || _playMode == EPlayMode.OfflinePlayMode)
+ {
+ State = InitState.VersionChecked;
+ State = InitState.Ready;
+ Debug.Log("[YooAssetInitializer] Skipped version check (local mode). State 鈫� Ready");
+ return;
+ }
+
+ try
+ {
+ foreach (var kvp in _packages)
+ {
+ var pkgName = kvp.Key;
+ var package = kvp.Value;
+
+ // 1. 璇锋眰鐗堟湰鍙�
+ var versionOp = package.RequestPackageVersionAsync();
+ await versionOp.ToUniTask();
+
+ if (versionOp.Status != EOperationStatus.Succeed)
+ {
+ Debug.LogWarning($"[YooAssetInitializer] RequestPackageVersion failed for '{pkgName}': {versionOp.Error}");
+ continue;
+ }
+
+ string packageVersion = versionOp.PackageVersion;
+ Debug.Log($"[YooAssetInitializer] Package '{pkgName}' version: {packageVersion}");
+
+ // 2. 鏇存柊 Manifest
+ var manifestOp = package.UpdatePackageManifestAsync(packageVersion);
+ await manifestOp.ToUniTask();
+
+ if (manifestOp.Status != EOperationStatus.Succeed)
+ {
+ Debug.LogWarning($"[YooAssetInitializer] UpdatePackageManifest failed for '{pkgName}': {manifestOp.Error}");
+ continue;
+ }
+
+ Debug.Log($"[YooAssetInitializer] Package '{pkgName}' manifest updated to {packageVersion}.");
+ }
+
+ State = InitState.VersionChecked;
+ State = InitState.Ready;
+ Debug.Log("[YooAssetInitializer] All packages version checked. State 鈫� Ready");
+ }
+ catch (Exception ex)
+ {
+ LastError = ex.Message;
+ State = InitState.VersionFailed;
+ Debug.LogError($"[YooAssetInitializer] Version update exception: {ex}");
+ }
+ }
+
+ // ====================================================================
+ // 涓嬭浇鍣ㄥ垱寤�
+ // ====================================================================
+
+ /// <summary>
+ /// 鍒涘缓璧勬簮涓嬭浇鍣紝鐢ㄤ簬涓嬭浇鎸囧畾鏍囩鐨勮繙绋嬭祫婧愩��
+ /// </summary>
+ /// <param name="tags">璧勬簮鏍囩鏁扮粍</param>
+ /// <param name="downloadingMaxNumber">鍚屾椂涓嬭浇鏈�澶ф暟閲�</param>
+ /// <param name="failedTryAgain">澶辫触閲嶈瘯娆℃暟</param>
+ /// <param name="packageName">鎸囧畾鍖呭悕锛宯ull 鍒欎娇鐢ㄩ粯璁ゅ寘</param>
+ /// <returns>涓嬭浇鍣ㄦ搷浣滃彞鏌�</returns>
+ public ResourceDownloaderOperation CreateDownloader(string[] tags,
+ int downloadingMaxNumber = 10, int failedTryAgain = 3, string packageName = null)
+ {
+ if (State < InitState.Ready)
+ {
+ Debug.LogError($"[YooAssetInitializer] Cannot create downloader in state: {State}");
+ return null;
+ }
+
+ var package = _defaultPackage;
+ if (!string.IsNullOrEmpty(packageName) && _packages.TryGetValue(packageName, out var target))
+ {
+ package = target;
+ }
+
+ // 澶氭爣绛惧悎骞朵笅杞藉櫒
+ if (tags == null || tags.Length == 0)
+ {
+ return package.CreateResourceDownloader(downloadingMaxNumber, failedTryAgain);
+ }
+
+ if (tags.Length == 1)
+ {
+ return package.CreateResourceDownloader(tags[0], downloadingMaxNumber, failedTryAgain);
+ }
+
+ // 澶氫釜鏍囩浣跨敤绗竴涓爣绛惧垱寤轰笅杞藉櫒锛圷ooAsset 2.x 涓嶆敮鎸佸鏍囩鍚堝苟鍒涘缓锛�
+ return package.CreateResourceDownloader(tags[0], downloadingMaxNumber, failedTryAgain);
+ }
+
+ /// <summary>
+ /// 鎵ц涓嬭浇鎿嶄綔骞剁瓑寰呭畬鎴愩��
+ /// </summary>
+ public async UniTask DownloadAsync(ResourceDownloaderOperation downloader,
+ IProgress<float> progress = null)
+ {
+ if (downloader == null)
+ {
+ Debug.LogWarning("[YooAssetInitializer] Downloader is null.");
+ return;
+ }
+
+ if (downloader.TotalDownloadCount == 0)
+ {
+ Debug.Log("[YooAssetInitializer] No resources need to download.");
+ progress?.Report(1f);
+ return;
+ }
+
+ Debug.Log($"[YooAssetInitializer] Start downloading {downloader.TotalDownloadCount} files, total {downloader.TotalDownloadBytes} bytes");
+
+ downloader.BeginDownload();
+
+ while (!downloader.IsDone)
+ {
+ progress?.Report(downloader.Progress);
+ await UniTask.Yield();
+ }
+
+ if (downloader.Status != EOperationStatus.Succeed)
+ {
+ Debug.LogError($"[YooAssetInitializer] Download failed: {downloader.Error}");
+ throw new InvalidOperationException($"Resource download failed: {downloader.Error}");
+ }
+
+ progress?.Report(1f);
+ Debug.Log("[YooAssetInitializer] Download completed.");
+ }
+
+ // ====================================================================
+ // 杈呭姪鏂规硶
+ // ====================================================================
+
+ private InitializeParameters CreateInitParameters(EPlayMode playMode, IRemoteServices remoteServices, string packageName)
+ {
+ switch (playMode)
+ {
+ case EPlayMode.EditorSimulateMode:
+ {
+#if UNITY_EDITOR
+ var simulateResult = EditorSimulateModeHelper.SimulateBuild(packageName);
+ return new EditorSimulateModeParameters
+ {
+ EditorFileSystemParameters = FileSystemParameters
+ .CreateDefaultEditorFileSystemParameters(simulateResult.PackageRootDirectory)
+ };
+#else
+ throw new InvalidOperationException("EditorSimulateMode is only available in Unity Editor.");
+#endif
+ }
+ case EPlayMode.HostPlayMode:
+ {
+ return new HostPlayModeParameters
+ {
+ BuildinFileSystemParameters = FileSystemParameters
+ .CreateDefaultBuildinFileSystemParameters(),
+ CacheFileSystemParameters = FileSystemParameters
+ .CreateDefaultCacheFileSystemParameters(remoteServices)
+ };
+ }
+ case EPlayMode.OfflinePlayMode:
+ {
+ return new OfflinePlayModeParameters
+ {
+ BuildinFileSystemParameters = FileSystemParameters
+ .CreateDefaultBuildinFileSystemParameters()
+ };
+ }
+ case EPlayMode.WebPlayMode:
+ {
+ var webParams = new WebPlayModeParameters();
+#if UNITY_WEBGL && WEIXINMINIGAME && !UNITY_EDITOR
+ // 寰俊灏忔父鎴忥細浣跨敤 WechatFileSystem 杩涜璧勬簮缂撳瓨
+ string packageRoot = $"{WeChatWASM.WX.env.USER_DATA_PATH}/__GAME_FILE_CACHE";
+ webParams.WebServerFileSystemParameters = WechatFileSystemCreater
+ .CreateFileSystemParameters(packageRoot, remoteServices);
+#elif UNITY_WEBGL && DOUYINMINIGAME && !UNITY_EDITOR
+ // 鎶栭煶灏忔父鎴忥細浣跨敤 TiktokFileSystem 杩涜璧勬簮缂撳瓨
+ string packageRoot = TTSDK.TTFileSystem.USER_DATA_PATH + "/__GAME_FILE_CACHE";
+ webParams.WebServerFileSystemParameters = TiktokFileSystemCreater
+ .CreateFileSystemParameters(packageRoot, remoteServices);
+#else
+ // 榛樿 WebGL锛氫娇鐢ㄦ爣鍑� WebServer 鏂囦欢绯荤粺
+ webParams.WebServerFileSystemParameters = FileSystemParameters
+ .CreateDefaultWebServerFileSystemParameters();
+ if (remoteServices != null)
+ {
+ webParams.WebRemoteFileSystemParameters = FileSystemParameters
+ .CreateDefaultWebRemoteFileSystemParameters(remoteServices);
+ }
+#endif
+ return webParams;
+ }
+ default:
+ throw new ArgumentOutOfRangeException(nameof(playMode), playMode, "Unsupported PlayMode.");
+ }
+ }
+
+ /// <summary>
+ /// 閲婃斁璧勬簮锛岄噸缃姸鎬併��
+ /// </summary>
+ public void Release()
+ {
+ _defaultPackage = null;
+ _packages.Clear();
+ _remoteServices = null;
+ LastError = null;
+ State = InitState.Uninitialized;
+ }
+}
diff --git a/Assets/Launch/Manager/YooAssetInitializer.cs.meta b/Assets/Launch/Manager/YooAssetInitializer.cs.meta
new file mode 100644
index 0000000..47924d2
--- /dev/null
+++ b/Assets/Launch/Manager/YooAssetInitializer.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fd8ad00c7c0e32543a87d5a6fd048067
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Launch/UI/LaunchWins/LaunchExWin.cs b/Assets/Launch/UI/LaunchWins/LaunchExWin.cs
index 198100f..8cccf3c 100644
--- a/Assets/Launch/UI/LaunchWins/LaunchExWin.cs
+++ b/Assets/Launch/UI/LaunchWins/LaunchExWin.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
+using Cysharp.Threading.Tasks;
using LaunchCommon;
public class LaunchExWin : MonoBehaviour
@@ -36,11 +37,35 @@
// m_BackGround.overrideSprite = sprite;
// m_BackGround.preserveAspect = true;
sliderText = InitialFunctionConfig.Get("Language").Numerical3;
+ // 鍚屾鍔犺浇淇濈暀锛圷ooAsset 鍒濆鍖栧悗璧� YooAsset sync API锛屽惁鍒欒蛋 legacy AB锛�
imagebg1.sprite = LocalResManager.Instance.LoadSprite("TY_TB_JH1");
imagebg2.sprite = LocalResManager.Instance.LoadSprite("TY_TB_JH1");
imageCircle.sprite = LocalResManager.Instance.LoadSprite("TY_TB_JH2");
imagebg3.sprite = LocalResManager.Instance.LoadSprite("LoadingBottom");
imageloding.sprite = LocalResManager.Instance.LoadSprite("LoadingSlider");
+ }
+
+ /// <summary>
+ /// 寮傛鍒濆鍖� Launch 鐣岄潰绮剧伒锛圵ebGL 鍏煎锛夈��
+ /// 鍦� OpenWindowAsync 涓皟鐢紝Awake 涓殑鍚屾鍔犺浇浠呬綔鍚庡銆�
+ /// </summary>
+ public async UniTask InitSpritesAsync()
+ {
+ sliderText = InitialFunctionConfig.Get("Language").Numerical3;
+ var sprites = await UniTask.WhenAll(
+ LocalResManager.Instance.LoadSpriteAsync("TY_TB_JH1"),
+ LocalResManager.Instance.LoadSpriteAsync("TY_TB_JH2"),
+ LocalResManager.Instance.LoadSpriteAsync("LoadingBottom"),
+ LocalResManager.Instance.LoadSpriteAsync("LoadingSlider")
+ );
+
+ if (this == null) return; // destroyed check after await
+
+ imagebg1.sprite = sprites.Item1;
+ imagebg2.sprite = sprites.Item1;
+ imageCircle.sprite = sprites.Item2;
+ imagebg3.sprite = sprites.Item3;
+ imageloding.sprite = sprites.Item4;
}
private void OnEnable()
@@ -134,4 +159,30 @@
window.transform.localScale = Vector3.zero;
return window;
}
+
+ /// <summary>
+ /// 寮傛鎵撳紑 Launch 绐楀彛锛圵ebGL 鍏煎锛夈��
+ /// 閫氳繃 YooAsset 寮傛鍔犺浇棰勫埗浣撳拰绮剧伒锛岄�傜敤浜庢墍鏈夊钩鍙般��
+ /// </summary>
+ public static async UniTask<GameObject> OpenWindowAsync()
+ {
+ var prefab = await LocalResManager.Instance.LoadBuiltInPrefabAsync("LaunchExWin");
+ if (prefab == null)
+ {
+ Debug.LogError("[LaunchExWin] Failed to load LaunchExWin prefab asynchronously.");
+ return null;
+ }
+
+ GameObject window = GameObject.Instantiate(prefab);
+ window.transform.localScale = Vector3.zero;
+
+ // 寮傛鍔犺浇绮剧伒
+ var launchWin = window.GetComponent<LaunchExWin>();
+ if (launchWin != null)
+ {
+ await launchWin.InitSpritesAsync();
+ }
+
+ return window;
+ }
}
\ No newline at end of file
diff --git a/Assets/Plugins/YooAsset.MiniGame.meta b/Assets/Plugins/YooAsset.MiniGame.meta
new file mode 100644
index 0000000..dacaeb5
--- /dev/null
+++ b/Assets/Plugins/YooAsset.MiniGame.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 448a76f35c893fb4598fda8d52e76a58
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Plugins/YooAsset.MiniGame/README.md b/Assets/Plugins/YooAsset.MiniGame/README.md
new file mode 100644
index 0000000..a19d299
--- /dev/null
+++ b/Assets/Plugins/YooAsset.MiniGame/README.md
@@ -0,0 +1,31 @@
+# YooAsset Mini Game File Systems
+
+姝ょ洰褰曞寘鍚皬娓告垙骞冲彴涓撶敤鐨� YooAsset 鏂囦欢绯荤粺瀹炵幇銆�
+
+## 瀵煎叆璇存槑
+
+浠� YooAsset 2.3.15 鐨� Samples~ 鐩綍鎸夐渶澶嶅埗瀵瑰簲骞冲彴鐨勫疄鐜帮細
+
+```
+Library/PackageCache/com.tuyoogame.yooasset@2.3.15/Samples~/Mini Game/Runtime/
+鈹溾攢鈹� WechatFileSystem/ 鈫� 澶嶅埗鍒� Assets/Plugins/YooAsset.MiniGame/WechatFileSystem/
+鈹溾攢鈹� TiktokFileSystem/ 鈫� 澶嶅埗鍒� Assets/Plugins/YooAsset.MiniGame/TiktokFileSystem/
+鈹斺攢鈹� YooAsset.MiniGame.asmdef
+```
+
+## 骞冲彴缂栬瘧瀹�
+
+- **寰俊灏忔父鎴�**: `UNITY_WEBGL && WEIXINMINIGAME`
+- **鎶栭煶灏忔父鎴�**: `UNITY_WEBGL && DOUYINMINIGAME`
+
+## 鏂囦欢绯荤粺缂撳瓨璺緞
+
+| 骞冲彴 | 缂撳瓨鏍硅矾寰� |
+|------|-----------|
+| 寰俊 | `WX.env.USER_DATA_PATH/__GAME_FILE_CACHE` |
+| 鎶栭煶 | `TTFileSystem.USER_DATA_PATH/__GAME_FILE_CACHE` |
+
+## 浣跨敤鏂瑰紡
+
+鍦� `YooAssetInitializer.CreateInitParameters` 鍜� `YooAssetService.CreateInitParameters` 涓凡闆嗘垚銆�
+褰撴娴嬪埌瀵瑰簲骞冲彴瀹忔椂锛屼細鑷姩浣跨敤瀵瑰簲鐨勬枃浠剁郴缁熷垱寤哄櫒銆�
diff --git a/Assets/Plugins/YooAsset.MiniGame/README.md.meta b/Assets/Plugins/YooAsset.MiniGame/README.md.meta
new file mode 100644
index 0000000..debfc38
--- /dev/null
+++ b/Assets/Plugins/YooAsset.MiniGame/README.md.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: fc233d1ce92f8164abbd31509b132529
+TextScriptImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Plugins/YooAsset.UniTask.meta b/Assets/Plugins/YooAsset.UniTask.meta
new file mode 100644
index 0000000..34f10ea
--- /dev/null
+++ b/Assets/Plugins/YooAsset.UniTask.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 2be0d63fc0ca312459c0d0c4a802efe2
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Plugins/YooAsset.UniTask/Runtime.meta b/Assets/Plugins/YooAsset.UniTask/Runtime.meta
new file mode 100644
index 0000000..fdfa414
--- /dev/null
+++ b/Assets/Plugins/YooAsset.UniTask/Runtime.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 448d43cd584a196498dedf8c0e71153f
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Plugins/YooAsset.UniTask/Runtime/External.meta b/Assets/Plugins/YooAsset.UniTask/Runtime/External.meta
new file mode 100644
index 0000000..87dccaf
--- /dev/null
+++ b/Assets/Plugins/YooAsset.UniTask/Runtime/External.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 7349d92658667a446946561d5ec25189
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset.meta b/Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset.meta
new file mode 100644
index 0000000..373f880
--- /dev/null
+++ b/Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 01c8f5fcda5fc6742b9c202dbd83146c
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/AsyncOperationBaseExtensions.cs b/Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/AsyncOperationBaseExtensions.cs
new file mode 100644
index 0000000..e1e8c38
--- /dev/null
+++ b/Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/AsyncOperationBaseExtensions.cs
@@ -0,0 +1,125 @@
+#if UNITASK_YOOASSET_SUPPORT
+using System;
+using YooAsset;
+using static Cysharp.Threading.Tasks.Internal.Error;
+
+namespace Cysharp.Threading.Tasks
+{
+ public static class AsyncOperationBaseExtensions
+ {
+ public static UniTask.Awaiter GetAwaiter(this AsyncOperationBase handle)
+ {
+ return ToUniTask(handle).GetAwaiter();
+ }
+ public static UniTask ToUniTask(this AsyncOperationBase handle, IProgress<float> progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update)
+ {
+ ThrowArgumentNullException(handle, nameof(handle));
+
+ if (handle.IsDone)
+ {
+ return UniTask.CompletedTask;
+ }
+
+ return new UniTask(
+ AsyncOperationBaserConfiguredSource.Create(handle, timing, progress, out var token),
+ token
+ );
+ }
+
+ sealed class AsyncOperationBaserConfiguredSource : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode<AsyncOperationBaserConfiguredSource>
+ {
+ private static TaskPool<AsyncOperationBaserConfiguredSource> _pool;
+ private AsyncOperationBaserConfiguredSource _nextNode;
+ private readonly Action<AsyncOperationBase> _continuationAction;
+ private AsyncOperationBase _handle;
+ private IProgress<float> _progress;
+ private bool _completed;
+ private UniTaskCompletionSourceCore<AsyncUnit> _core;
+
+ public ref AsyncOperationBaserConfiguredSource NextNode => ref _nextNode;
+
+ static AsyncOperationBaserConfiguredSource()
+ {
+ TaskPool.RegisterSizeGetter(typeof(AsyncOperationBaserConfiguredSource), () => _pool.Size);
+ }
+
+ AsyncOperationBaserConfiguredSource() { _continuationAction = Continuation; }
+
+ public static IUniTaskSource Create(AsyncOperationBase handle, PlayerLoopTiming timing, IProgress<float> progress, out short token)
+ {
+ if (!_pool.TryPop(out var result))
+ {
+ result = new AsyncOperationBaserConfiguredSource();
+ }
+
+ result._handle = handle;
+ result._progress = progress;
+ result._completed = false;
+ TaskTracker.TrackActiveTask(result, 3);
+
+ if (progress != null)
+ {
+ PlayerLoopHelper.AddAction(timing, result);
+ }
+
+ handle.Completed += result._continuationAction;
+ token = result._core.Version;
+ return result;
+ }
+
+ private void Continuation(AsyncOperationBase _)
+ {
+ _handle.Completed -= _continuationAction;
+
+ if (_completed)
+ {
+ TryReturn();
+ }
+ else
+ {
+ _completed = true;
+ if (_handle.Status == EOperationStatus.Failed)
+ {
+ _core.TrySetException(new Exception(_handle.Error));
+ }
+ else
+ {
+ _core.TrySetResult(AsyncUnit.Default);
+ }
+ }
+ }
+ private bool TryReturn()
+ {
+ TaskTracker.RemoveTracking(this);
+ _core.Reset();
+ _handle = default;
+ _progress = default;
+ return _pool.TryPush(this);
+ }
+
+ public UniTaskStatus GetStatus(short token) => _core.GetStatus(token);
+ public void OnCompleted(Action<object> continuation, object state, short token)
+ {
+ _core.OnCompleted(continuation, state, token);
+ }
+ public void GetResult(short token) { _core.GetResult(token); }
+ public UniTaskStatus UnsafeGetStatus() => _core.UnsafeGetStatus();
+ public bool MoveNext()
+ {
+ if (_completed)
+ {
+ TryReturn();
+ return false;
+ }
+
+ if (!_handle.IsDone)
+ {
+ _progress?.Report(_handle.Progress);
+ }
+
+ return true;
+ }
+ }
+ }
+}
+#endif
diff --git a/Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/AsyncOperationBaseExtensions.cs.meta b/Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/AsyncOperationBaseExtensions.cs.meta
new file mode 100644
index 0000000..db5f045
--- /dev/null
+++ b/Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/AsyncOperationBaseExtensions.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 2cceff5ec1f84bd0a6a9b4ed7719527c
+timeCreated: 1651978895
\ No newline at end of file
diff --git a/Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/OperationHandleBaseExtensions.cs b/Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/OperationHandleBaseExtensions.cs
new file mode 100644
index 0000000..d94b8d9
--- /dev/null
+++ b/Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/OperationHandleBaseExtensions.cs
@@ -0,0 +1,221 @@
+#if UNITASK_YOOASSET_SUPPORT
+#if UNITY_2020_1_OR_NEWER && ! UNITY_2021
+#define UNITY_2020_BUG
+#endif
+
+using System;
+using System.Runtime.CompilerServices;
+using YooAsset;
+using static Cysharp.Threading.Tasks.Internal.Error;
+
+namespace Cysharp.Threading.Tasks
+{
+ public static class HandleBaseExtensions
+ {
+ public static UniTask.Awaiter GetAwaiter(this HandleBase handle)
+ {
+ return ToUniTask(handle).GetAwaiter();
+ }
+ public static UniTask ToUniTask(this HandleBase handle, IProgress<float> progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update)
+ {
+ ThrowArgumentNullException(handle, nameof(handle));
+
+ if (!handle.IsValid)
+ {
+ return UniTask.CompletedTask;
+ }
+
+ return new UniTask(
+ HandleBaserConfiguredSource.Create(handle, timing, progress, out var token),
+ token
+ );
+ }
+
+ sealed class HandleBaserConfiguredSource : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode<HandleBaserConfiguredSource>
+ {
+ private static TaskPool<HandleBaserConfiguredSource> _pool;
+ private HandleBaserConfiguredSource _nextNode;
+ private readonly Action<HandleBase> _continuationAction;
+ private HandleBase _handle;
+ private IProgress<float> _progress;
+ private bool _completed;
+ private UniTaskCompletionSourceCore<AsyncUnit> _core;
+
+ public ref HandleBaserConfiguredSource NextNode => ref _nextNode;
+
+ static HandleBaserConfiguredSource()
+ {
+ TaskPool.RegisterSizeGetter(typeof(HandleBaserConfiguredSource), () => _pool.Size);
+ }
+
+ HandleBaserConfiguredSource() { _continuationAction = Continuation; }
+
+ public static IUniTaskSource Create(HandleBase handle, PlayerLoopTiming timing, IProgress<float> progress, out short token)
+ {
+ if (!_pool.TryPop(out var result))
+ {
+ result = new HandleBaserConfiguredSource();
+ }
+
+ result._handle = handle;
+ result._progress = progress;
+ result._completed = false;
+ TaskTracker.TrackActiveTask(result, 3);
+
+ if (progress != null)
+ {
+ PlayerLoopHelper.AddAction(timing, result);
+ }
+
+ // BUG 鍦� Unity 2020.3.36 鐗堟湰娴嬭瘯涓�, IL2Cpp 浼氭姤 濡備笅閿欒
+ // BUG ArgumentException: Incompatible Delegate Types. First is System.Action`1[[YooAsset.AssetHandle, YooAsset, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]] second is System.Action`1[[YooAsset.OperationHandleBase, YooAsset, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]
+ // BUG 涔熷彲鑳芥姤鐨勬槸 Action '1' Action '1' 鐨� InvalidCastException
+ // BUG 姝ゅ涓嶅緱涓嶈繖涔堜慨鏀�, 濡傛灉鍚庣画 Unity 淇浜嗚繖涓棶棰�, 鍙互鎭㈠涔嬪墠鐨勫啓娉�
+#if UNITY_2020_BUG
+ switch (handle)
+ {
+ case AssetHandle asset_handle:
+ asset_handle.Completed += result.AssetContinuation;
+ break;
+ case SceneHandle scene_handle:
+ scene_handle.Completed += result.SceneContinuation;
+ break;
+ case SubAssetsHandle sub_asset_handle:
+ sub_asset_handle.Completed += result.SubContinuation;
+ break;
+ case RawFileHandle raw_file_handle:
+ raw_file_handle.Completed += result.RawFileContinuation;
+ break;
+ case AllAssetsHandle all_assets_handle:
+ all_assets_handle.Completed += result.AllAssetsContinuation;
+ break;
+ }
+#else
+ switch (handle)
+ {
+ case AssetHandle asset_handle:
+ asset_handle.Completed += result.continuationAction;
+ break;
+ case SceneHandle scene_handle:
+ scene_handle.Completed += result.continuationAction;
+ break;
+ case SubAssetsHandle sub_asset_handle:
+ sub_asset_handle.Completed += result.continuationAction;
+ break;
+ case RawFileHandle raw_file_handle:
+ raw_file_handle.Completed += result.continuationAction;
+ break;
+ case AllAssetsHandle all_assets_handle:
+ all_assets_handle.Completed += result.continuationAction;
+ break;
+ }
+#endif
+ token = result._core.Version;
+ return result;
+ }
+
+#if UNITY_2020_BUG
+ private void AssetContinuation(AssetHandle handle)
+ {
+ handle.Completed -= AssetContinuation;
+ BaseContinuation();
+ }
+ private void SceneContinuation(SceneHandle handle)
+ {
+ handle.Completed -= SceneContinuation;
+ BaseContinuation();
+ }
+ private void SubContinuation(SubAssetsHandle handle)
+ {
+ handle.Completed -= SubContinuation;
+ BaseContinuation();
+ }
+ private void RawFileContinuation(RawFileHandle handle)
+ {
+ handle.Completed -= RawFileContinuation;
+ BaseContinuation();
+ }
+ private void AllAssetsContinuation(AllAssetsHandle handle)
+ {
+ handle.Completed -= AllAssetsContinuation;
+ BaseContinuation();
+ }
+#endif
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ private void BaseContinuation()
+ {
+ if (_completed)
+ {
+ TryReturn();
+ }
+ else
+ {
+ _completed = true;
+ if (_handle.Status == EOperationStatus.Failed)
+ {
+ _core.TrySetException(new Exception(_handle.LastError));
+ }
+ else
+ {
+ _core.TrySetResult(AsyncUnit.Default);
+ }
+ }
+ }
+ private void Continuation(HandleBase _)
+ {
+ switch (_handle)
+ {
+ case AssetHandle asset_handle:
+ asset_handle.Completed -= _continuationAction;
+ break;
+ case SceneHandle scene_handle:
+ scene_handle.Completed -= _continuationAction;
+ break;
+ case SubAssetsHandle sub_asset_handle:
+ sub_asset_handle.Completed -= _continuationAction;
+ break;
+ case RawFileHandle raw_file_handle:
+ raw_file_handle.Completed -= _continuationAction;
+ break;
+ case AllAssetsHandle all_assets_handle:
+ all_assets_handle.Completed -= _continuationAction;
+ break;
+ }
+
+ BaseContinuation();
+ }
+ private bool TryReturn()
+ {
+ TaskTracker.RemoveTracking(this);
+ _core.Reset();
+ _handle = default;
+ _progress = default;
+ return _pool.TryPush(this);
+ }
+
+ public UniTaskStatus GetStatus(short token) => _core.GetStatus(token);
+ public void OnCompleted(Action<object> continuation, object state, short token)
+ {
+ _core.OnCompleted(continuation, state, token);
+ }
+ public void GetResult(short token) { _core.GetResult(token); }
+ public UniTaskStatus UnsafeGetStatus() => _core.UnsafeGetStatus();
+ public bool MoveNext()
+ {
+ if (_completed)
+ {
+ TryReturn();
+ return false;
+ }
+
+ if (_handle.IsValid)
+ {
+ _progress?.Report(_handle.Progress);
+ }
+
+ return true;
+ }
+ }
+ }
+}
+#endif
\ No newline at end of file
diff --git a/Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/OperationHandleBaseExtensions.cs.meta b/Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/OperationHandleBaseExtensions.cs.meta
new file mode 100644
index 0000000..b43f66e
--- /dev/null
+++ b/Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/OperationHandleBaseExtensions.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: e1c9a3a6de2246bf88547a6b59b99b9f
+timeCreated: 1650851321
\ No newline at end of file
diff --git a/Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/UniTask.YooAsset.asmdef b/Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/UniTask.YooAsset.asmdef
new file mode 100644
index 0000000..12cb38f
--- /dev/null
+++ b/Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/UniTask.YooAsset.asmdef
@@ -0,0 +1,23 @@
+{
+ "name": "UniTask.YooAsset",
+ "rootNamespace": "",
+ "references": [
+ "GUID:f51ebe6a0ceec4240a699833d6309b23",
+ "GUID:e34a5702dd353724aa315fb8011f08c3"
+ ],
+ "includePlatforms": [],
+ "excludePlatforms": [],
+ "allowUnsafeCode": false,
+ "overrideReferences": false,
+ "precompiledReferences": [],
+ "autoReferenced": true,
+ "defineConstraints": [],
+ "versionDefines": [
+ {
+ "name": "com.cysharp.unitask",
+ "expression": "",
+ "define": "UNITASK_YOOASSET_SUPPORT"
+ }
+ ],
+ "noEngineReferences": false
+}
\ No newline at end of file
diff --git a/Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/UniTask.YooAsset.asmdef.meta b/Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/UniTask.YooAsset.asmdef.meta
new file mode 100644
index 0000000..b67a08f
--- /dev/null
+++ b/Assets/Plugins/YooAsset.UniTask/Runtime/External/YooAsset/UniTask.YooAsset.asmdef.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 1278a46ce459c5a46b4eaeda148684ef
+AssemblyDefinitionImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Plugins/YooAsset.UniTask/UniTaskRef.meta b/Assets/Plugins/YooAsset.UniTask/UniTaskRef.meta
new file mode 100644
index 0000000..fa335e7
--- /dev/null
+++ b/Assets/Plugins/YooAsset.UniTask/UniTaskRef.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 9a37bcddb33f328418a9c5eaa682e6dd
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Plugins/YooAsset.UniTask/UniTaskRef/UniTaskRef.asmref b/Assets/Plugins/YooAsset.UniTask/UniTaskRef/UniTaskRef.asmref
new file mode 100644
index 0000000..7e7a5fe
--- /dev/null
+++ b/Assets/Plugins/YooAsset.UniTask/UniTaskRef/UniTaskRef.asmref
@@ -0,0 +1,3 @@
+{
+ "reference": "GUID:f51ebe6a0ceec4240a699833d6309b23"
+}
\ No newline at end of file
diff --git a/Assets/Plugins/YooAsset.UniTask/UniTaskRef/UniTaskRef.asmref.meta b/Assets/Plugins/YooAsset.UniTask/UniTaskRef/UniTaskRef.asmref.meta
new file mode 100644
index 0000000..b42d4ea
--- /dev/null
+++ b/Assets/Plugins/YooAsset.UniTask/UniTaskRef/UniTaskRef.asmref.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: fb1a9972a41e10f40a752774a402830a
+AssemblyDefinitionReferenceImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Plugins/YooAsset.UniTask/UniTaskRef/_InternalVisibleTo.cs b/Assets/Plugins/YooAsset.UniTask/UniTaskRef/_InternalVisibleTo.cs
new file mode 100644
index 0000000..11bd319
--- /dev/null
+++ b/Assets/Plugins/YooAsset.UniTask/UniTaskRef/_InternalVisibleTo.cs
@@ -0,0 +1,3 @@
+using System.Runtime.CompilerServices;
+
+[assembly: InternalsVisibleTo("UniTask.YooAsset")]
\ No newline at end of file
diff --git a/Assets/Plugins/YooAsset.UniTask/UniTaskRef/_InternalVisibleTo.cs.meta b/Assets/Plugins/YooAsset.UniTask/UniTaskRef/_InternalVisibleTo.cs.meta
new file mode 100644
index 0000000..02f9470
--- /dev/null
+++ b/Assets/Plugins/YooAsset.UniTask/UniTaskRef/_InternalVisibleTo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: dc0f48d84ee89ad499856840eea08a64
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
--
Gitblit v1.8.0