void InitCinemaNativeInterface(string packageName) { #if UNITY_ANDROID && !UNITY_EDITOR AndroidJavaClass nativeInterfaceClass = new AndroidJavaClass(string.Format("com.ssnwt.vr.{0}.jni.NativeInterface", packageName)); if (nativeInterfaceClass == null) { return; } AndroidJavaObject AndroidInterface = nativeInterfaceClass.CallStatic <AndroidJavaObject>("getInstance"); if (AndroidInterface == null) { return; } AndroidInterface.Call("init", GlobalAppManage.GetJApplication()); switch (packageName) { case "mediascan": AndroidMediaScanInterface = AndroidInterface; break; case "playermanager": AndroidPlayerInterface = AndroidInterface; break; } LogTool.Log("AndroidInterface通过jApplication初始化, InitCinemaNativeInterface"); #endif }
void InitAndroidInterface() { if (IsInit) { return; } IsInit = true; #if UNITY_ANDROID && !UNITY_EDITOR AndroidJavaClass AndroidInterfaceClass = new AndroidJavaClass("com.ssnwt.vr.androidmanager.AndroidInterface"); if (AndroidInterfaceClass == null) { return; } AndroidInterface = AndroidInterfaceClass.CallStatic <AndroidJavaObject>("getInstance"); if (AndroidInterface == null) { return; } AndroidInterface.Call("init", GlobalAppManage.GetJApplication()); LogTool.Log("AndroidInterface通过jApplication初始化"); #endif }