コード例 #1
0
        private void _Initialize()
        {
            m_EarlyUpdateCallback = new EarlyUpdateCallback(_EarlyUpdateTrampoline);
            ExternApi.ArCoreUnity_setArPrestoInitialized(m_EarlyUpdateCallback);

            IntPtr javaVMHandle   = IntPtr.Zero;
            IntPtr activityHandle = IntPtr.Zero;

            ExternApi.ArCoreUnity_getJniInfo(ref javaVMHandle, ref activityHandle);

            m_CheckApkAvailabilityResultCallback =
                new CheckApkAvailabilityResultCallback(_OnCheckApkAvailabilityResultTrampoline);

            m_RequestApkInstallationResultCallback =
                new RequestApkInstallationResultCallback(_OnApkInstallationResultTrampoline);

            m_RequestCameraPermissionCallback =
                new CameraPermissionRequestProvider(_RequestCameraPermissionTrampoline);

            m_OnBeforeSetConfigurationCallback =
                new OnBeforeSetConfigurationCallback(_BeforeSetConfigurationTrampoline);

            m_OnBeforeResumeSessionCallback = new OnBeforeResumeSessionCallback(_BeforeResumeSessionTrampoline);

            ExternApi.ArPresto_initialize(javaVMHandle, activityHandle, m_RequestCameraPermissionCallback,
                                          m_OnBeforeSetConfigurationCallback, m_OnBeforeResumeSessionCallback);
        }
コード例 #2
0
        private void _Initialize()
        {
#if !UNITY_EDITOR
            m_EarlyUpdateCallback = new EarlyUpdateCallback(_EarlyUpdateTrampoline);

            if (InstantPreviewManager.IsProvidingPlatform)
            {
                // Instant preview does not support updated function signature returning 'bool'.

                ExternApi.ArCoreUnity_setArPrestoInitialized(m_EarlyUpdateCallback);
            }
            else if (!ExternApi.ArCoreUnity_setArPrestoInitialized(m_EarlyUpdateCallback))
            {
                Debug.LogError(
                    "Missing Unity Engine ARCore support.  Please ensure that the Unity project " +
                    "has the 'Player Settings > XR Settings > ARCore Supported' checkbox enabled.");
            }

            IntPtr javaVMHandle   = IntPtr.Zero;
            IntPtr activityHandle = IntPtr.Zero;
            ExternApi.ArCoreUnity_getJniInfo(ref javaVMHandle, ref activityHandle);

            m_CheckApkAvailabilityResultCallback =
                new CheckApkAvailabilityResultCallback(_OnCheckApkAvailabilityResultTrampoline);

            m_RequestApkInstallationResultCallback =
                new RequestApkInstallationResultCallback(_OnApkInstallationResultTrampoline);

            m_RequestCameraPermissionCallback =
                new CameraPermissionRequestProvider(_RequestCameraPermissionTrampoline);

            m_OnBeforeSetConfigurationCallback =
                new OnBeforeSetConfigurationCallback(_BeforeSetConfigurationTrampoline);

            m_OnBeforeResumeSessionCallback =
                new OnBeforeResumeSessionCallback(_BeforeResumeSessionTrampoline);

            ExternApi.ArPresto_initialize(
                javaVMHandle, activityHandle, m_RequestCameraPermissionCallback,
                m_OnBeforeSetConfigurationCallback, m_OnBeforeResumeSessionCallback);
#endif
        }
コード例 #3
0
 public static extern void ArPresto_requestApkInstallation(
     bool user_requested, RequestApkInstallationResultCallback onResult, IntPtr context);