refactor: Update Unity to 2022.3.62

This commit is contained in:
2025-06-21 01:22:02 +08:00
parent d71bf7d4a5
commit 283783954f
112 changed files with 778 additions and 907 deletions

View File

@@ -33,7 +33,7 @@ namespace Cryville.Crtr.Network {
if (_shutdown) Application.Quit();
}
}
static readonly Uri BaseUri = new Uri("https://www.cryville.world/api/crtr/index");
static readonly Uri BaseUri = new("https://www.cryville.world/api/crtr/index");
List<VersionInfo> _versions;
void ThreadLogic() {
try {
@@ -48,10 +48,9 @@ namespace Cryville.Crtr.Network {
void CheckVersion() {
using (var client = new Https11Client(BaseUri)) {
client.Connect();
using (var response = client.Request("GET", new Uri(BaseUri, "versions"))) {
var data = Encoding.UTF8.GetString(response.MessageBody.ReadToEnd());
_versions = JsonConvert.DeserializeObject<List<VersionInfo>>(data, Game.GlobalJsonSerializerSettings);
}
using var response = client.Request("GET", new Uri(BaseUri, "versions"));
var data = Encoding.UTF8.GetString(response.MessageBody.ReadToEnd());
_versions = JsonConvert.DeserializeObject<List<VersionInfo>>(data, Game.GlobalJsonSerializerSettings);
}
var availableVersions = _versions.Where(v => v.platforms.ContainsKey(PlatformConfig.Name)).ToArray();
var versionIndex = new Dictionary<string, int>(availableVersions.Length);
@@ -132,15 +131,12 @@ namespace Cryville.Crtr.Network {
}
void Download(VersionResourceInfo diff, string path) {
var uri = new Uri(diff.url);
using (var client = new Https11Client(uri)) {
client.Connect();
using (var response = client.Request("GET", uri)) {
var data = response.MessageBody.ReadToEnd();
using (var file = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None)) {
file.Write(data);
}
}
}
using var client = new Https11Client(uri);
client.Connect();
using var response = client.Request("GET", uri);
var data = response.MessageBody.ReadToEnd();
using var file = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None);
file.Write(data);
}
void ExecuteUpdate(List<string> diffPaths) {
#if UNITY_EDITOR