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
			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.
#endif
		}
	}
}
