Пример #1
0
        private void ManageCharged(InputMonitor monitor)
        {
            if (!Input.GetMouseButton(0) || monitor.IsDragging)
            {
                BeginInactive();
                return;
            }

            var progress = Mathf.Clamp(1 - (Time.time - _chargedTime) * 4, 0, 1);

            _indicator.color = new Color(1, 1, 1, progress);
        }
Пример #2
0
        private void ManageCharging(InputMonitor monitor)
        {
            if (!Input.GetMouseButton(0) || monitor.IsDragging)
            {
                BeginInactive();
                return;
            }

            var progress = Mathf.Clamp((Time.time - _beginTime - _delay) / _chargeLength, 0, 1);

            if (progress >= 1)
            {
                BeginCharged();
                return;
            }

            _indicator.color      = new Color(1, 1, 1, progress);
            _indicator.fillAmount = progress;
        }
Пример #3
0
        private void ManageState(InputMonitor monitor)
        {
            switch (State)
            {
            case LongPressState.Inactive:
                ManageInactive();
                break;

            case LongPressState.Charging:
                ManageCharging(monitor);
                break;

            case LongPressState.Charged:
                ManageCharged(monitor);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Пример #4
0
 public void UpdateInput(InputMonitor monitor)
 {
     ManageState(monitor);
     RightClick();
 }