Compare commits

...

6 Commits

Author SHA1 Message Date
何冠峰
7089952895 Update CHANGELOG.md 2024-08-15 11:55:53 +08:00
何冠峰
737d2a796b Update CHANGELOG.md 2024-08-15 11:54:39 +08:00
何冠峰
e25fd14675 Update package.json 2024-08-15 11:54:34 +08:00
何冠峰
c55dc713f4 fix : fixed the host play mode init stuck
修复HostPlayMode初始化卡死问题。
2024-08-15 11:53:25 +08:00
何冠峰
418536ded1 perf : check collect asset type
检测收集的资源类型是否有效
2024-08-13 19:13:26 +08:00
何冠峰
ae454b72dc update extension sample 2024-08-13 10:54:29 +08:00
5 changed files with 54 additions and 6 deletions

View File

@@ -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

View File

@@ -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>

View File

@@ -219,7 +219,6 @@ namespace YooAsset
Error = "Failed to create buildin file system";
return;
}
return;
}
if (_parameters.DeliveryFileSystemParameters != null)

View File

@@ -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

View File

@@ -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": {