add file open

This commit is contained in:
2020-08-07 22:40:04 +08:00
parent c1e3f992aa
commit f9bedd2c62
115 changed files with 9835 additions and 1096 deletions

View File

@@ -0,0 +1,24 @@
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
}
}