- Home /
Question by
HitarthPadaliya · Jun 09, 2021 at 03:58 AM ·
c#uiscript.slider
How to get float value based on the element size?
I am currently working a game where I need an element which if I click will give me a value which is based on the element size. For example, in the illustration below, the left value is 0.0f
and the right value is 1.0f
.
I have the code and I want to do this in the OnPointerDown(PointerEventData)
function. Here's my code:-
using ...
public class TestNumeric : IPointerDownHandler
{
...
public override void OnPointerDown(PointerEventData eventData)
{
if (eventData.button != PointerEventData.InputButton.Left) return;
// code here
}
}
How can I achieve this? If anyone knows, please reply to me. Thanks in advance.
ill1.png
(10.5 kB)
Comment