示例#1
0
        void OnPostRenderListener(int cacheTextureId, NxrViewer.Eye eyeType)
        {
            if (NxrGlobal.isVR9Platform)
            {
                if (eyeType == NxrViewer.Eye.Right && Application.isMobilePlatform)
                {
                    if (NxrGlobal.DEBUG_LOG_ENABLED)
                    {
                        Debug.Log("OnPostRenderListener.PrepareFrame.Right");
                    }
                    NxrPluginEvent.Issue(NibiruRenderEventType.PrepareFrame);
                }
                return;
            }

            if (NxrViewer.USE_DTR && NxrGlobal.supportDtr)
            {
                // 左右眼绘制结束
                NibiruRenderEventType eventType = eyeType == NxrViewer.Eye.Left ? NibiruRenderEventType.LeftEyeEndFrame : NibiruRenderEventType.RightEyeEndFrame;
                // 左右眼绘制结束事件
                // int eyeTextureId = (int)cam.targetTexture.GetNativeTexturePtr();
                NxrPluginEvent.IssueWithData(eventType, cacheTextureId);
                if (NxrGlobal.DEBUG_LOG_ENABLED)
                {
                    Debug.Log("OnPostRender.eye[" + eyeType + "]");
                }
            }

            if (NxrViewer.USE_DTR && eyeType == NxrViewer.Eye.Right)
            {
                // NxrViewer.Instance.EnterXRMode();
            }
        }
示例#2
0
 public override void OnApplicationPause(bool pause)
 {
     Debug.Log("NxrDevice->OnApplicationPause." + pause);
     base.OnApplicationPause(pause);
     // 程序暂停
     if (pause)
     {
         Debug.Log("NxrDevice->OnPause");
         if (NxrViewer.USE_DTR)
         {
             NxrSDKApi.Instance.IsInXRMode = false;
             NxrPluginEvent.Issue(HoloeverRenderEventType.EndVR);
             _NVR_ApplicationPause();
         }
     }
     else
     {
         Debug.Log("NxrDevice->OnResume");
         if (NxrViewer.USE_DTR)
         {
             NxrSDKApi.Instance.IsInXRMode = true;
             NxrPluginEvent.Issue(HoloeverRenderEventType.BeginVR);
             _NVR_ApplicationResume();
             UpdateScreenData();
         }
     }
 }
示例#3
0
 public override void EnterARMode()
 {
     Debug.Log("NxrDevice->EnterARMode");
     NxrPluginEvent.Issue(HoloeverRenderEventType.BeginVR);
     _NVR_ApplicationResume();
     // 更新参数信息
     UpdateScreenData();
 }
示例#4
0
 public override void OnApplicationQuit()
 {
     if (NxrViewer.USE_DTR && !applicationQuited)
     {  // 关闭陀螺仪
         Input.gyro.enabled = false;
         NxrPluginEvent.Issue(HoloeverRenderEventType.ShutDown);
         _NVR_ApplicationDestory();
     }
     applicationQuited = true;
     base.OnApplicationQuit();
     Debug.Log("NxrDevice->OnApplicationQuit.");
 }
示例#5
0
 void OnPreRenderListener(int cacheTextureId, NxrViewer.Eye eyeType)
 {
     if (NxrGlobal.isVR9Platform)
     {
         return;
     }
     if (NxrViewer.USE_DTR && NxrGlobal.supportDtr)
     {
         // 左右眼绘制开始
         NibiruRenderEventType eventType = eyeType == NxrViewer.Eye.Left ? NibiruRenderEventType.LeftEyeBeginFrame : NibiruRenderEventType.RightEyeBeginFrame;
         NxrPluginEvent.IssueWithData(eventType, cacheTextureId);
         if (NxrGlobal.DEBUG_LOG_ENABLED)
         {
             Debug.Log("OnPreRender.eye[" + eyeType + "]");
         }
     }
 }