示例#1
0
    public void UpdateTouchValue(float touchInputValue)
    {
        InputValue.value = touchInputValue;

        if (!IsInputButtonHold)
        {
            OnInputUpdate?.Invoke(true);
            IsInputButtonHold = true;
        }
    }
示例#2
0
    public void ResetInputValue(float defaultValue = 0)
    {
        if (InputSlider)
        {
            InputSlider.value = defaultValue;
        }

        InputValue.value  = defaultValue;
        IsInputButtonHold = false;
        OnInputUpdate?.Invoke(false);
    }
示例#3
0
    public void UpdateSliderValue()
    {
        if (InputSlider)
        {
            InputValue.value = InputSlider.value;
        }

        if (!IsInputButtonHold)
        {
            OnInputUpdate?.Invoke(true);
            IsInputButtonHold = true;
        }
    }
示例#4
0
        private void Update()
        {
            var rawNavInput   = _selectionAxes.GetInput();
            var selectionAxes = ProcessNavInput(rawNavInput);

            var cameraAxes = _cameraAxes.GetInput();

            var submitInput = _submitButton.GetButtonDown();
            var cancelInput = _cancelButton.GetButtonDown();

            if (_usingMouseInput)
            {
                cameraAxes += _mouseCameraInput.GetInput();
            }

            _prevNavInput = rawNavInput;

            // Send payload
            var payload = new MapInputPayload(selectionAxes, cameraAxes, submitInput, cancelInput);

            OnInputUpdate?.Invoke(payload);
        }
示例#5
0
    private void OnInputTick()
    {
        if (Input.GetKey(KeyCode.LeftControl))
        {
            return;
        }

        if (Input.GetMouseButton(0))
        {
            var cell = GetCellFromMousePos();

            Fill(cell, editRadius);
            OnInputUpdate?.Invoke();
        }

        if (Input.GetMouseButton(1))
        {
            var cell = GetCellFromMousePos();

            Fill(cell, editRadius, 0);
            OnInputUpdate?.Invoke();
        }
    }
示例#6
0
 private void SliderListener(int index, float value)
 {
     OnInputUpdate?.Invoke(index, value);
 }