com.typhoon.unitysdk 1.0.56 → 1.0.57

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,13 @@
1
1
  # 更新日志
2
+ ## [1.0.57] - 2023-12-10
3
+
4
+ ### 优化
5
+ * 安装版本改为Client.Add
6
+
7
+
2
8
  ## [1.0.56] - 2023-12-10
3
9
 
4
- ### 其它
10
+ ### 其它
5
11
  * 测试更新机制2
6
12
 
7
13
 
@@ -9,6 +9,7 @@ using System.Text;
9
9
  using System.Text.RegularExpressions;
10
10
  using System.Threading.Tasks;
11
11
  using UnityEditor;
12
+ using UnityEditor.PackageManager;
12
13
  using UnityEngine;
13
14
  using AlphaDirectory = Alphaleonis.Win32.Filesystem.Directory;
14
15
  using Debug = UnityEngine.Debug;
@@ -1147,18 +1148,15 @@ namespace TyphoonUnitySDK
1147
1148
  try
1148
1149
  {
1149
1150
  var package = $"Packages/manifest.json";
1150
- var json = File.ReadAllText(package);
1151
- var pattern = $"\"com.typhoon.unitysdk\"[\\s]*:[\\s]*\"{current.Version}\"";
1152
- if (Regex.IsMatch(json, pattern))
1151
+ if (!File.Exists(package))
1153
1152
  {
1154
- json = Regex.Replace(json, pattern, $"\"com.typhoon.unitysdk\": \"{versionInfo.Version}\"");
1155
- File.WriteAllText(package, json);
1156
- Debug.Log($"更改成功,刷新工程...");
1157
- AssetDatabase.Refresh();
1153
+ var pack = $"com.typhoon.unitysdk@{versionInfo.Version}";
1154
+ Client.Add(pack);
1155
+ Debug.Log($"写入:{pack} 完毕,等待刷新");
1158
1156
  }
1159
1157
  else
1160
1158
  {
1161
- Debug.LogError($"找不到com.typhoon.unitysdk条目");
1159
+ Debug.LogError($"找不到{package}");
1162
1160
  }
1163
1161
  }
1164
1162
  catch (Exception e)
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.56","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.56] - 2023-12-10\r\n\r\n### 其它\n* 测试更新机制2\r\n\r\n","major_flag":false,"write_time_stamp":1702193455000,"others":{"items":[]},"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}
1
+ {"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.57","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.57] - 2023-12-10\r\n\r\n### 优化\n* 安装版本改为Client.Add\r\n\r\n","major_flag":false,"write_time_stamp":1702194932000,"others":{"items":[]},"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}