Implement opening external package link.
This commit is contained in:
13
Assets/Cryville/Common/Unity/UrlOpener.cs
Normal file
13
Assets/Cryville/Common/Unity/UrlOpener.cs
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user