Example #1
0
        private void RedrawValueMarkers()
        {
            if (!axisSelected)
            {
                calibratedValueMarker.anchoredPosition = new Vector2(0, calibratedValueMarker.anchoredPosition.y);
                rawValueMarker.anchoredPosition        = new Vector2(0, rawValueMarker.anchoredPosition.y);
                return;
            }

            float value    = joystick.GetAxis(selectedAxis);
            float rawValue = Mathf.Clamp(joystick.GetAxisRaw(selectedAxis), -1.0f, 1.0f);

            calibratedValueMarker.anchoredPosition = new Vector2(displayAreaWidth * 0.5f * value, calibratedValueMarker.anchoredPosition.y);
            rawValueMarker.anchoredPosition        = new Vector2(displayAreaWidth * 0.5f * rawValue, rawValueMarker.anchoredPosition.y);
        }