Example #1
0
        private void Update()
        {
            if (Application.isPlaying)
            {
                var deviceIsPresent = XRSupportUtil.IsXRDevicePresent();
                if (deviceIsPresent)
                {
                    if (enableRuntimeAdjustment)
                    {
                        if (Input.GetKeyDown(stepUpKey))
                        {
                            roomScaleHeightOffset += stepSize;
                        }

                        if (Input.GetKeyDown(stepDownKey))
                        {
                            roomScaleHeightOffset -= stepSize;
                        }
                    }

                    if (recenterOnUserPresence && !XRSupportUtil.IsLargePlayspace())
                    {
                        var userPresence = XRSupportUtil.IsUserPresent();

                        if (_lastUserPresence != userPresence)
                        {
                            if (userPresence)
                            {
                                XRSupportUtil.Recenter();
                            }

                            _lastUserPresence = userPresence;
                        }
                    }

                    if (recenterOnKey && Input.GetKeyDown(recenterKey))
                    {
                        XRSupportUtil.Recenter();
                    }
                }
            }
        }