예제 #1
0
        /// <summary>
        /// Loads native plugin libraries on platforms where this is explicitly required.
        /// </summary>
        public void LoadNativeLibraries()
        {
#if ((UNITY_IPHONE || UNITY_IOS) && !UNITY_EDITOR)
            VuforiaWrapper.SetImplementation(new VuforiaNativeIosWrapper());
#endif
        }
 private void UpdateStatePrivate(bool forceUpdate, bool reapplyOldState)
 {
     if (this.mCheckStopCamera)
     {
         this.DisableCameraIfNotNeeded();
         this.mCheckStopCamera = false;
     }
     if (VuforiaManager.Instance.Initialized && this.mCameraConfiguration != null)
     {
         this.ApplyMissedProjectionMatrices();
     }
     if (forceUpdate || Time.frameCount > this.mLastUpdatedFrame)
     {
         this.DeinitRequestedTrackers();
         if (VuforiaManager.Instance.Initialized)
         {
             UnityPlayer.Instance.Update();
             ScreenOrientation counterRotation;
             this.mCameraConfiguration.CheckForSurfaceChanges(out counterRotation);
             if (!this.mMetalRendering)
             {
                 this.mClearMaterial.SetPass(0);
             }
             if (((VuforiaManagerImpl)VuforiaManager.Instance).Update(counterRotation, reapplyOldState))
             {
                 IOSCamRecoveringHelper.SetSuccessfullyRecovered();
                 this.ResetBackgroundPlane(false);
                 using (List <ITrackerEventHandler> .Enumerator enumerator = this.mTrackerEventHandlers.GetEnumerator())
                 {
                     while (enumerator.MoveNext())
                     {
                         enumerator.Current.OnTrackablesUpdated();
                     }
                 }
                 this.mCameraConfiguration.UpdateStereoDepth(VuforiaManager.Instance.CentralAnchorPoint);
                 if (this.mOnTrackablesUpdated != null)
                 {
                     this.mOnTrackablesUpdated.InvokeWithExceptionHandling();
                 }
             }
             else
             {
                 IOSCamRecoveringHelper.TryToRecover();
             }
             if (this.mRenderOnUpdate != null)
             {
                 this.mRenderOnUpdate.InvokeWithExceptionHandling();
             }
         }
         else if (VuforiaRuntimeUtilities.IsPlayMode() && !this.mStartHasBeenInvoked)
         {
             Debug.LogWarning("Scripts have been recompiled during Play mode, need to restart!");
             VuforiaWrapper.CreateRuntimeInstance();
             PlayModeEditorUtility.Instance.RestartPlayMode();
         }
         if (VuforiaRenderer.InternalInstance.HasBackgroundTextureChanged())
         {
             this.mBackgroundTextureHasChanged = true;
             if (this.mOnBackgroundTextureChanged != null)
             {
                 this.mOnBackgroundTextureChanged.InvokeWithExceptionHandling();
             }
         }
         this.mEyewearBehaviour.SetFocusPoint();
         this.mLastUpdatedFrame = Time.frameCount;
     }
 }