Exemplo n.º 1
0
    protected virtual void InputUpdate()
    {
        if (!isActive || !_targetElement.IsActive || _targetElement.BlockedBySelection)
        {
            return;
        }

        if (GetInputValues(out var axisValH, out var axisValV))
        {
            _remainTime -= Time.deltaTime;

            if (_remainTime <= 0f)
            {
                _currentRepeatTime = Mathf.Clamp(_currentRepeatTime - repeatTimeAccelStep, repeatTime.y, repeatTime.x);
                _remainTime        = _currentRepeatTime;

                var signH = Mathf.Abs(axisValH) > 0.5f ? Mathf.Sign(axisValH) * (inverseH ? -1f : 1f) : 0f;
                var signV = Mathf.Abs(axisValV) > 0.5f ? Mathf.Sign(axisValV) * (inverseV ? -1f : 1f) : 0f;

                NavigationStep((int)signH, (int)signV);
            }
        }
        else
        {
            _remainTime        = 0f;
            _currentRepeatTime = repeatTime.x;
        }

        if (SubmitButtonUp())
        {
            _targetElement?.ActivateSelectedChild();
        }

        if (CancelButtonUp())
        {
            //CancelPressed();
        }
    }