Files
tianrunCRM/Assets/3rd/DocumentHandler/Runtime/DocumentHandler.cs
2020-08-07 22:40:04 +08:00

25 lines
557 B
C#

using System;
using System.Runtime.InteropServices;
using UnityEngine;
namespace drstc.DocumentHandler
{
public class DocumentHandler : MonoBehaviour
{
#if UNITY_IPHONE && !UNITY_EDITOR
[DllImport("__Internal")]
internal static extern bool _OpenDocument(string path);
public static void OpenDocument(string path)
{
_OpenDocument(path);
}
#else
public static void OpenDocument(string path)
{
Application.OpenURL("file:///" + path);
}
#endif
}
}