Code cleanup.

This commit is contained in:
2023-07-11 00:03:47 +08:00
parent d89423caf5
commit 1dcbc03829
3 changed files with 12 additions and 3 deletions

View File

@@ -4,10 +4,19 @@ namespace Cryville.Common.Unity {
#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN
System.Diagnostics.Process.Start(url);
#elif UNITY_ANDROID
UnityEngine.AndroidJNI.AttachCurrentThread();
using (var clazz = new UnityEngine.AndroidJavaClass("world.cryville.common.unity.UrlOpener")) {
clazz.CallStatic("open", url);
}
#else
#error Unknown platform.
#endif
}
public static void OpenThreaded(string url) {
#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN
Open(url);
#elif UNITY_ANDROID
UnityEngine.AndroidJNI.AttachCurrentThread();
Open(url);
UnityEngine.AndroidJNI.DetachCurrentThread();
#else
#error Unknown platform.

View File

@@ -344,7 +344,7 @@ namespace Cryville.Crtr {
}
else {
var itv = ((InputVectorSrc)tv).Get();
if (!hfv || _vecs[pid] != itv) _vecs[pid] = itv;
if (!hfv || ifv != itv) _vecs[pid] = itv;
}
}
}

View File

@@ -90,7 +90,7 @@ namespace Cryville.Crtr.Network {
if (totalDiffSize == 0 || totalDiffSize >= fullPackage.size) {
// TODO Check if external
if (Dialog.ShowAndWait(string.Format("A new version is available: {0}\nYou have to download the full package.\nOpen the download link now?", latestVersion.name), "Yes", "No") == 0) {
UrlOpener.Open(fullPackage.url);
UrlOpener.OpenThreaded(fullPackage.url);
}
}
else {