コード例 #1
0
        public int TargetUnitsInMeter = 100 * 100; // 100 units per cm, 100 cm in 1 m

        void OnEnable()
        {
            DisplayParameters displayParameters = DisplayParameters.Collect();

            GetComponent <RectTransform>().localScale =
                new Vector3(
                    displayParameters.Dpm.x / TargetUnitsInMeter,
                    displayParameters.Dpm.y / TargetUnitsInMeter,
                    1f);
        }
コード例 #2
0
        void Update()
        {
            DisplayParameters newDisplay = DisplayParameters.Collect();

            if (_hmdParamsDirty || !newDisplay.Equals(_display))
            {
                UpdateViewAndMaterialParameters(HmdParameters.Instance, newDisplay);
                _hmdParamsDirty = false;
                _display        = newDisplay;
            }
        }