예제 #1
0
        private void Init(OnSetupVRReady _)
        {
            if (VRSF_Components.DeviceLoaded != EDevice.SIMULATOR)
            {
                // 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 = UnityUIToVRSFUI.ScrollbarDirectionToUIDirection(verticalScrollbar.direction);
                    verticalScrollbar.onValueChanged.AddListener(delegate { OnValueChangedCallback(); });
                }
                else if (horizontal && horizontalScrollbar != null)
                {
                    Direction = UnityUIToVRSFUI.ScrollbarDirectionToUIDirection(horizontalScrollbar.direction);
                    horizontalScrollbar.onValueChanged.AddListener(delegate { OnValueChangedCallback(); });
                }

                ObjectWasClickedEvent.Listeners += CheckRectClick;
                _eventWereRegistered             = true;

                // We setup the Min and Max pos transform
                _scrollableSetup.CheckMinMaxGameObjects(transform, Direction, ref _minPosBar, ref _maxPosBar);
            }
        }
예제 #2
0
        private void Init(OnSetupVRReady _)
        {
            if (VRSF_Components.DeviceLoaded != EDevice.SIMULATOR)
            {
                ObjectWasClickedEvent.Listeners += CheckSliderClick;
                ObjectWasHoveredEvent.Listeners += CheckObjectOvered;

                CheckSliderReferences();

                _scrollableSetup = new VRUIScrollableSetup(UnityUIToVRSFUI.SliderDirectionToUIDirection(direction), minValue, maxValue, wholeNumbers);
                _scrollableSetup.CheckMinMaxGameObjects(handleRect.parent, UnityUIToVRSFUI.SliderDirectionToUIDirection(direction), ref _minPosBar, ref _maxPosBar);
            }
        }
예제 #3
0
        private void Init(OnSetupVRReady _)
        {
            if (VRSF_Components.DeviceLoaded != EDevice.SIMULATOR)
            {
                GetHandleRectReference();

                // We register the Listener
                ObjectWasClickedEvent.Listeners += CheckBarClick;
                ObjectWasHoveredEvent.Listeners += CheckObjectOvered;

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

                value = 1;
            }
        }