public void ParserControllerState(ControllerState state)
        {
            if (!_screen_adapted)
            {
                AdaptPhoneScreenSize();
            }
            _device_touch_x       = state.touchPos.x;
            _device_touch_y       = state.touchPos.y;
            _physical_button_down = _physical_button;
            _physical_button      = (Mathf.Abs(_device_touch_x) > PRECISION || Mathf.Abs(_device_touch_y) > PRECISION);

            if (_device_touch_x < _touch_area_x_min ||
                _device_touch_x > _touch_area_x_max ||
                _device_touch_y < _touch_area_y_min ||
                _device_touch_y > _touch_area_y_max ||
                !_physical_button)
            {
                _touch_status = false;
                _touch.x      = 0f;
                _touch.y      = 0f;
            }
            else
            {
                _touch_status = true;
                _touch.x      = _device_touch_x / (_touch_area_x_max - _touch_area_x_min) * 2f;
                _touch.y      = (_device_touch_y - _touch_area_y_center) / (_touch_area_y_max - _touch_area_y_min) * 2f;
            }

            lock (_buttons)
            {
                lock (_down)
                {
                    for (int i = 0; i < _buttons.Length; ++i)
                    {
                        _down[i] = _buttons[i];
                    }
                }

                if (_current_down_btn != -1)
                {
                    _buttons[_current_down_btn] = _physical_button;
                    if (!_buttons[_current_down_btn])
                    {
                        _current_down_btn = -1;
                    }
                }
                else
                {
                    _buttons[0] = false;  //Trigger
                    _buttons[1] = false;  //App
                    _buttons[2] = false;  //Home
                    bool _is_down = !_physical_button_down & _physical_button;
                    if (_touch_status)
                    {
                        _buttons[0] = _physical_button && _is_down;
                    }
                    else if (_device_touch_y > _touch_area_y_max)
                    {
                        _buttons[1] = _physical_button && _is_down;
                    }
                    else if (_device_touch_y < _touch_area_y_min)
                    {
                        _buttons[2] = _physical_button && _is_down;
                    }

                    _current_down_btn = -1;
                    for (int i = 0; i < 3; i++)
                    {
                        if (_buttons[i])
                        {
                            _current_down_btn = i;
                            break;
                        }
                    }
                }

                lock (_buttons_up)
                {
                    lock (_buttons_down)
                    {
                        for (int i = 0; i < _buttons.Length; ++i)
                        {
                            _buttons_up[i]   = (_down[i] & !_buttons[i]);
                            _buttons_down[i] = (!_down[i] & _buttons[i]);
                        }
                    }
                }
            }

            state.isTouching   = _touch_status;
            state.touchPos     = _touch;
            state.buttonsState =
                (_buttons[0] ? ControllerButton.TRIGGER : 0)
                | (_buttons[1] ? ControllerButton.APP : 0)
                | (_buttons[2] ? ControllerButton.HOME : 0);
            state.buttonsDown =
                (_buttons_down[0] ? ControllerButton.TRIGGER : 0)
                | (_buttons_down[1] ? ControllerButton.APP : 0)
                | (_buttons_down[2] ? ControllerButton.HOME : 0);
            state.buttonsUp =
                (_buttons_up[0] ? ControllerButton.TRIGGER : 0)
                | (_buttons_up[1] ? ControllerButton.APP : 0)
                | (_buttons_up[2] ? ControllerButton.HOME : 0);

            if (_buttons_down[0] || _buttons_down[1] || _buttons_down[2])
            {
                NRInput.TriggerHapticVibration(0.1f);
            }
        }