Implement opening external package link.

This commit is contained in:
2023-07-03 01:10:45 +08:00
parent 864ea91be0
commit 83b9c27e94
5 changed files with 77 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
namespace Cryville.Common.Unity {
public static class UrlOpener {
public static void Open(string url) {
#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN
System.Diagnostics.Process.Start(url);
#elif UNITY_ANDROID
new UnityEngine.AndroidJavaClass("world.cryville.common.unity.UrlOpener").CallStatic("open", new object[] { url });
#else
#error Unknown platform.
#endif
}
}
}