using System; using UnityEngine; namespace Cryville.Interop.Java.Unity { /// /// The Unity JNI Invocation API. /// /// /// and are not implemented. /// All parameters of type are not supported and ignored. /// always succeeds. /// public class JniInvoke : IJniInvoke { static JniInvoke m_instance; public static JniInvoke Instance { get { if (m_instance == null) m_instance = new JniInvoke(); return m_instance; } } JniInvoke() { } public IJniEnv AttachCurrentThread(JavaVMAttachArgs? thr_args) { JniException.Check((JniResult)AndroidJNI.AttachCurrentThread()); return JniEnv.Instance; } public IJniEnv AttachCurrentThreadAsDaemon(JavaVMAttachArgs? args) => throw new NotImplementedException(); public void DestroyJavaVM() => throw new NotImplementedException(); public void DetachCurrentThread() => JniException.Check((JniResult)AndroidJNI.DetachCurrentThread()); public IJniEnv GetEnv(int version) => JniEnv.Instance; } }