GoToUrl.cs 463 B

123456789101112131415161718192021
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Runtime.InteropServices;
  4. using UnityEngine;
  5. namespace Imagine.WebAR.Samples
  6. {
  7. public class GoToUrl : MonoBehaviour
  8. {
  9. [DllImport("__Internal")] private static extern void ShowConfirmUrl(string url);
  10. public void GoTo(string url){
  11. #if UNITY_EDITOR || !UNITY_WEBGL
  12. Application.OpenURL(url);
  13. #else
  14. ShowConfirmUrl(url);
  15. #endif
  16. }
  17. }
  18. }