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); } }
protected override void Awake() { base.Awake(); if (Application.isPlaying) { _scrollableSetup = new VRUIScrollableSetup(Direction); OnSetupVRReady.RegisterSetupVRResponse(Init); // We setup the BoxCollider size and center StartCoroutine(SetupBoxCollider()); } }
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; } }