mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-15 04:00:16 +00:00
Compare commits
6 Commits
2.2.3-prev
...
2.2.4-prev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7089952895 | ||
|
|
737d2a796b | ||
|
|
e25fd14675 | ||
|
|
c55dc713f4 | ||
|
|
418536ded1 | ||
|
|
ae454b72dc |
@@ -2,6 +2,12 @@
|
||||
|
||||
All notable changes to this package will be documented in this file.
|
||||
|
||||
## [2.2.4-preview] - 2024-08-15
|
||||
|
||||
### Fixed
|
||||
|
||||
- 修复了HostPlayMode初始化卡死的问题。
|
||||
|
||||
## [2.2.3-preview] - 2024-08-13
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -42,6 +42,12 @@ namespace YooAsset.Editor
|
||||
AssetPath = assetPath;
|
||||
AssetGUID = UnityEditor.AssetDatabase.AssetPathToGUID(AssetPath);
|
||||
AssetType = UnityEditor.AssetDatabase.GetMainAssetTypeAtPath(AssetPath);
|
||||
|
||||
// 注意:如果资源文件损坏或者实例化关联脚本丢失,获取的资源类型会无效!
|
||||
if (AssetType == null)
|
||||
{
|
||||
throw new Exception($"Found invalid asset : {AssetPath}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -219,7 +219,6 @@ namespace YooAsset
|
||||
Error = "Failed to create buildin file system";
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (_parameters.DeliveryFileSystemParameters != null)
|
||||
|
||||
@@ -21,6 +21,36 @@ public static class WechatFileSystemCreater
|
||||
/// </summary>
|
||||
internal class WechatFileSystem : IFileSystem
|
||||
{
|
||||
private class WebRemoteServices : IRemoteServices
|
||||
{
|
||||
private readonly string _webPackageRoot;
|
||||
protected readonly Dictionary<string, string> _mapping = new Dictionary<string, string>(10000);
|
||||
|
||||
public WebRemoteServices(string buildinPackRoot)
|
||||
{
|
||||
_webPackageRoot = buildinPackRoot;
|
||||
}
|
||||
string IRemoteServices.GetRemoteMainURL(string fileName)
|
||||
{
|
||||
return GetFileLoadURL(fileName);
|
||||
}
|
||||
string IRemoteServices.GetRemoteFallbackURL(string fileName)
|
||||
{
|
||||
return GetFileLoadURL(fileName);
|
||||
}
|
||||
|
||||
private string GetFileLoadURL(string fileName)
|
||||
{
|
||||
if (_mapping.TryGetValue(fileName, out string url) == false)
|
||||
{
|
||||
string filePath = PathUtility.Combine(_webPackageRoot, fileName);
|
||||
url = DownloadSystemHelper.ConvertToWWWPath(filePath);
|
||||
_mapping.Add(fileName, url);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly Dictionary<string, string> _wxFilePaths = new Dictionary<string, string>(10000);
|
||||
private WXFileSystemManager _wxFileSystemMgr;
|
||||
private string _wxFileCacheRoot = string.Empty;
|
||||
@@ -52,12 +82,12 @@ internal class WechatFileSystem : IFileSystem
|
||||
}
|
||||
}
|
||||
|
||||
#region 自定义参数
|
||||
#region 自定义参数
|
||||
/// <summary>
|
||||
/// 自定义参数:远程服务接口
|
||||
/// </summary>
|
||||
public IRemoteServices RemoteServices { private set; get; } = null;
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
|
||||
public WechatFileSystem()
|
||||
@@ -129,6 +159,13 @@ internal class WechatFileSystem : IFileSystem
|
||||
{
|
||||
PackageName = packageName;
|
||||
|
||||
// 注意:CDN服务未启用的情况下,使用微信WEB服务器
|
||||
if (RemoteServices == null)
|
||||
{
|
||||
string webRoot = PathUtility.Combine(Application.streamingAssetsPath, YooAssetSettingsData.Setting.DefaultYooFolderName, packageName);
|
||||
RemoteServices = new WebRemoteServices(webRoot);
|
||||
}
|
||||
|
||||
_wxFileSystemMgr = WX.GetFileSystemManager();
|
||||
_wxFileCacheRoot = WX.env.USER_DATA_PATH; //注意:如果有子目录,请修改此处!
|
||||
}
|
||||
@@ -171,7 +208,7 @@ internal class WechatFileSystem : IFileSystem
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
#region 内部方法
|
||||
#region 内部方法
|
||||
private string GetWXFileLoadPath(PackageBundle bundle)
|
||||
{
|
||||
if (_wxFilePaths.TryGetValue(bundle.BundleGUID, out string filePath) == false)
|
||||
@@ -181,6 +218,6 @@ internal class WechatFileSystem : IFileSystem
|
||||
}
|
||||
return filePath;
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
#endif
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "com.tuyoogame.yooasset",
|
||||
"displayName": "YooAsset",
|
||||
"version": "2.2.3-preview",
|
||||
"version": "2.2.4-preview",
|
||||
"unity": "2019.4",
|
||||
"description": "unity3d resources management system.",
|
||||
"author": {
|
||||
|
||||
Reference in New Issue
Block a user