Beispiel #1
0
        public void CreateExternalSurface(PXR_OverLay overlayInstance)
        {
#if UNITY_ANDROID && !UNITY_EDITOR
            if (overlayInstance.externalAndroidSurfaceObject == IntPtr.Zero)
            {
                PXR_Plugin.Render.UPxr_GetLayerAndroidSurface(overlayInstance.layerIndex, 0, ref overlayInstance.externalAndroidSurfaceObject);
                PLog.i(TAG, string.Format("CreateExternalSurface: Overlay Type:{0}, LayerDepth:{1}, SurfaceObject:{2}", overlayInstance.overlayType, overlayInstance.layerIndex, overlayInstance.externalAndroidSurfaceObject));

                if (overlayInstance.externalAndroidSurfaceObject != IntPtr.Zero)
                {
                    if (overlayInstance.externalAndroidSurfaceObjectCreated != null)
                    {
                        overlayInstance.externalAndroidSurfaceObjectCreated();
                    }
                }
            }
#endif
        }
        private void SetFrameRate()
        {
            int targetFrameRate    = (int)PXR_Plugin.System.UPxr_GetConfigInt(ConfigType.TargetFrameRate);
            int displayRefreshRate = (int)PXR_Plugin.System.UPxr_GetConfigFloat(ConfigType.DisplayRefreshRate);

            Application.targetFrameRate = targetFrameRate > 0 ? targetFrameRate : displayRefreshRate;
            if (!useDefaultFps)
            {
                if (customFps <= displayRefreshRate)
                {
                    Application.targetFrameRate = customFps;
                }
                else
                {
                    Application.targetFrameRate = displayRefreshRate;
                }
            }
            PLog.i(TAG, string.Format("Customize FPS : {0}", Application.targetFrameRate));
        }
Beispiel #3
0
        public void SetTexture(Texture texture, bool dynamic)
        {
            if (isExternalAndroidSurface)
            {
                PLog.w(TAG, "Not support setTexture !");
                return;
            }

            toCopyRT = false;
            PXR_Plugin.Render.UPxr_DestroyLayerByRender(layerIndex);
            DestroyLayerTextures();
            for (int i = 0; i < layerTextures.Length; i++)
            {
                layerTextures[i] = texture;
            }

            isDynamic = dynamic;
            InitializeBuffer();
        }