Exemplo n.º 1
0
        private void SetupVRScrollRect()
        {
            _scrollableSetup = new VRUIScrollableSetup(Direction);

            // We setup the references to the ScrollRect elements
            SetScrollRectReferences();

            // We override the directio selected in the inspector by the scrollbar direction if we use one
            // The vertical direction will always have top priority on the horizontal direction
            if (vertical && verticalScrollbar != null)
            {
                Direction = UnityUIToVRDFUI.ScrollbarDirectionToUIDirection(verticalScrollbar.direction);
                verticalScrollbar.onValueChanged.AddListener(delegate { OnValueChangedCallback(); });
            }
            else if (horizontal && horizontalScrollbar != null)
            {
                Direction = UnityUIToVRDFUI.ScrollbarDirectionToUIDirection(horizontalScrollbar.direction);
                horizontalScrollbar.onValueChanged.AddListener(delegate { OnValueChangedCallback(); });
            }

            OnVRClickerStartClicking.Listeners += CheckClickedObject;
            OnVRClickerStopClicking.Listeners  += CheckUnclickedObject;

            // We setup the Min and Max pos transform
            _scrollableSetup.CheckMinMaxGameObjects(transform, Direction, ref _minPosBar, ref _maxPosBar);
            _scrollableSetup.CheckContentStatus(viewport, content);
        }
Exemplo n.º 2
0
        private void SliderSetup()
        {
            OnSetupVRReady.RegisterSetupVRCallback(CheckDevice);

            CheckSliderReferences();

            _scrollableSetup = new VRUIScrollableSetup(UnityUIToVRDFUI.SliderDirectionToUIDirection(direction), minValue, maxValue, wholeNumbers);
            _scrollableSetup.CheckMinMaxGameObjects(handleRect.parent, UnityUIToVRDFUI.SliderDirectionToUIDirection(direction), ref _minPosBar, ref _maxPosBar);
        }
Exemplo n.º 3
0
        private void ScrollbarSetup()
        {
            GetHandleRectReference();

            OnSetupVRReady.RegisterSetupVRCallback(CheckDevice);

            _scrollableSetup = new VRUIScrollableSetup(UnityUIToVRDFUI.ScrollbarDirectionToUIDirection(direction));
            // Check if the Min and Max object are already created, and set there references
            _scrollableSetup.CheckMinMaxGameObjects(handleRect.parent, UnityUIToVRDFUI.ScrollbarDirectionToUIDirection(direction), ref _minPosBar, ref _maxPosBar);

            value = 1;
        }