mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-19 06:40:21 +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.
|
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
|
## [2.2.3-preview] - 2024-08-13
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -42,6 +42,12 @@ namespace YooAsset.Editor
|
|||||||
AssetPath = assetPath;
|
AssetPath = assetPath;
|
||||||
AssetGUID = UnityEditor.AssetDatabase.AssetPathToGUID(AssetPath);
|
AssetGUID = UnityEditor.AssetDatabase.AssetPathToGUID(AssetPath);
|
||||||
AssetType = UnityEditor.AssetDatabase.GetMainAssetTypeAtPath(AssetPath);
|
AssetType = UnityEditor.AssetDatabase.GetMainAssetTypeAtPath(AssetPath);
|
||||||
|
|
||||||
|
// 注意:如果资源文件损坏或者实例化关联脚本丢失,获取的资源类型会无效!
|
||||||
|
if (AssetType == null)
|
||||||
|
{
|
||||||
|
throw new Exception($"Found invalid asset : {AssetPath}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -219,7 +219,6 @@ namespace YooAsset
|
|||||||
Error = "Failed to create buildin file system";
|
Error = "Failed to create buildin file system";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_parameters.DeliveryFileSystemParameters != null)
|
if (_parameters.DeliveryFileSystemParameters != null)
|
||||||
|
|||||||
@@ -21,6 +21,36 @@ public static class WechatFileSystemCreater
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
internal class WechatFileSystem : IFileSystem
|
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 readonly Dictionary<string, string> _wxFilePaths = new Dictionary<string, string>(10000);
|
||||||
private WXFileSystemManager _wxFileSystemMgr;
|
private WXFileSystemManager _wxFileSystemMgr;
|
||||||
private string _wxFileCacheRoot = string.Empty;
|
private string _wxFileCacheRoot = string.Empty;
|
||||||
@@ -52,12 +82,12 @@ internal class WechatFileSystem : IFileSystem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 自定义参数
|
#region 自定义参数
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自定义参数:远程服务接口
|
/// 自定义参数:远程服务接口
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IRemoteServices RemoteServices { private set; get; } = null;
|
public IRemoteServices RemoteServices { private set; get; } = null;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
public WechatFileSystem()
|
public WechatFileSystem()
|
||||||
@@ -129,6 +159,13 @@ internal class WechatFileSystem : IFileSystem
|
|||||||
{
|
{
|
||||||
PackageName = packageName;
|
PackageName = packageName;
|
||||||
|
|
||||||
|
// 注意:CDN服务未启用的情况下,使用微信WEB服务器
|
||||||
|
if (RemoteServices == null)
|
||||||
|
{
|
||||||
|
string webRoot = PathUtility.Combine(Application.streamingAssetsPath, YooAssetSettingsData.Setting.DefaultYooFolderName, packageName);
|
||||||
|
RemoteServices = new WebRemoteServices(webRoot);
|
||||||
|
}
|
||||||
|
|
||||||
_wxFileSystemMgr = WX.GetFileSystemManager();
|
_wxFileSystemMgr = WX.GetFileSystemManager();
|
||||||
_wxFileCacheRoot = WX.env.USER_DATA_PATH; //注意:如果有子目录,请修改此处!
|
_wxFileCacheRoot = WX.env.USER_DATA_PATH; //注意:如果有子目录,请修改此处!
|
||||||
}
|
}
|
||||||
@@ -171,7 +208,7 @@ internal class WechatFileSystem : IFileSystem
|
|||||||
throw new System.NotImplementedException();
|
throw new System.NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 内部方法
|
#region 内部方法
|
||||||
private string GetWXFileLoadPath(PackageBundle bundle)
|
private string GetWXFileLoadPath(PackageBundle bundle)
|
||||||
{
|
{
|
||||||
if (_wxFilePaths.TryGetValue(bundle.BundleGUID, out string filePath) == false)
|
if (_wxFilePaths.TryGetValue(bundle.BundleGUID, out string filePath) == false)
|
||||||
@@ -181,6 +218,6 @@ internal class WechatFileSystem : IFileSystem
|
|||||||
}
|
}
|
||||||
return filePath;
|
return filePath;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "com.tuyoogame.yooasset",
|
"name": "com.tuyoogame.yooasset",
|
||||||
"displayName": "YooAsset",
|
"displayName": "YooAsset",
|
||||||
"version": "2.2.3-preview",
|
"version": "2.2.4-preview",
|
||||||
"unity": "2019.4",
|
"unity": "2019.4",
|
||||||
"description": "unity3d resources management system.",
|
"description": "unity3d resources management system.",
|
||||||
"author": {
|
"author": {
|
||||||
|
|||||||
Reference in New Issue
Block a user