com.typhoon.unitysdk 1.0.53 → 1.0.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,7 +1,15 @@
1
1
  # 更新日志
2
- ## [1.0.53] - 2023-12-10
2
+ ## [1.0.54] - 2023-12-10
3
3
 
4
4
  ### 修复
5
+ * 修正Latest配置的发布时间
6
+ * 更新时写入manifest出错
7
+ * 更新时的日志改为log
8
+
9
+
10
+ ## [1.0.53] - 2023-12-10
11
+
12
+ ### 修复
5
13
  * 拉取最新版本信息时GET请求避免本地缓存问题
6
14
 
7
15
 
@@ -58,6 +58,16 @@ namespace TyphoonUnitySDK
58
58
  {
59
59
  Latest = latest;
60
60
  AllVersions = all;
61
+ foreach (var info in AllVersions)
62
+ {
63
+ if (Latest.Version == info.Version)
64
+ {
65
+ //修正发布时间
66
+ Latest.PublishTimeStamp = info.PublishTimeStamp;
67
+ break;
68
+ }
69
+ }
70
+
61
71
  Save();
62
72
  }
63
73
 
@@ -6,6 +6,7 @@ using System.IO;
6
6
  using System.Linq;
7
7
  using System.Net.Http;
8
8
  using System.Text;
9
+ using System.Text.RegularExpressions;
9
10
  using System.Threading.Tasks;
10
11
  using UnityEditor;
11
12
  using UnityEngine;
@@ -1147,21 +1148,18 @@ namespace TyphoonUnitySDK
1147
1148
  {
1148
1149
  var package = $"Packages/manifest.json";
1149
1150
  var json = File.ReadAllText(package);
1150
- var map = json.ToXObject<Dictionary<string, object>>();
1151
- var dependencies = map["dependencies"].ToString();
1152
- var depMap = dependencies.ToXObject<Dictionary<string, string>>();
1153
- foreach (var pair in depMap)
1151
+ var pattern = $"\"com.typhoon.unitysdk\"[\\s]*:[\\s]*\"{current.Version}\"";
1152
+ if (Regex.IsMatch(json, pattern))
1154
1153
  {
1155
- Debug.Log($"{pair.Key},{pair.Value}");
1154
+ json = Regex.Replace(json, pattern, $"\"com.typhoon.unitysdk\": \"{versionInfo.Version}\"");
1155
+ File.WriteAllText(package, json);
1156
+ Debug.Log($"更改成功,刷新工程...");
1157
+ AssetDatabase.Refresh();
1158
+ }
1159
+ else
1160
+ {
1161
+ Debug.LogError($"找不到com.typhoon.unitysdk条目");
1156
1162
  }
1157
-
1158
- //修改版本号
1159
- depMap["com.typhoon.unitysdk"] = $"{versionInfo.Version}";
1160
- map["dependencies"] = depMap.ToXJson();
1161
- var final = map.ToXJson();
1162
- File.WriteAllText(package, final);
1163
- Debug.LogError($"更改成功,刷新工程...");
1164
- AssetDatabase.Refresh();
1165
1163
  }
1166
1164
  catch (Exception e)
1167
1165
  {
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.53","description":"","unity":"2018.1","type":"tool","hideInEditor":false,"author":{"name":"Jan Zhang","email":"","url":""},"changelogUrl":"","documentationUrl":"","keywords":["typhoon"],"license":"","licensesUrl":"","customDependencies":[{"PackageName":"com.unity.nuget.newtonsoft-json","Value":"2.0.0"}],"version_log":"## [1.0.53] - 2023-12-10\r\n\r\n### 修复\n* 拉取最新版本信息时GET请求避免本地缓存问题\r\n\r\n","major_flag":false,"write_time_stamp":1702191533000,"others":{"items":[]},"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}
1
+ {"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.54","description":"","unity":"2018.1","type":"tool","hideInEditor":false,"author":{"name":"Jan Zhang","email":"","url":""},"changelogUrl":"","documentationUrl":"","keywords":["typhoon"],"license":"","licensesUrl":"","customDependencies":[{"PackageName":"com.unity.nuget.newtonsoft-json","Value":"2.0.0"}],"version_log":"## [1.0.54] - 2023-12-10\r\n\r\n### 修复\n* 修正Latest配置的发布时间\r\n* 更新时写入manifest出错\r\n* 更新时的日志改为log\r\n\r\n","major_flag":true,"write_time_stamp":1702192601000,"others":{"items":[]},"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}