Example #1
0
 private void Awake()
 {
     _inputBroadcaster = FindObjectOfType <InputBroadcasterBaseBehaviour> ();
     _inputBroadcaster.didPerformInput          += OnControlInputWasPerformed;
     _inputBroadcaster.didPerformMouseDragInput += OnMouseDragInputWasPerformed;
     _inputBroadcaster.didRealeaseInput         += OnInputReleased;
     _sensevity = (_inputBroadcaster.settings as DesktopInputSettings).mouseSensevity;
 }
Example #2
0
        private void OnControlInputWasPerformed(InputBroadcasterBaseBehaviour sender, MovementInputEventArgs args)
        {
            if (Mathf.Approximately(args.horisontalWorldInputValue, 0f) && Mathf.Approximately(args.verticalWorldInputValue, 0f))
            {
                _quedVelocityGain = Vector3.zero;
            }

            if (_canPlayAccelerate)
            {
                PlayerAudioBehaviour.PlaySound(EAudioEventType.accelerate, transform.position);
                _canPlayAccelerate = false;
            }

            _quedVelocityGain.x += args.horisontalWorldInputValue;
            _quedVelocityGain.z += args.verticalWorldInputValue;
        }
Example #3
0
 void OnMouseDragInputWasPerformed(InputBroadcasterBaseBehaviour sender, MovementInputEventArgs args)
 {
     _queuedRotation = args.horisontalWorldInputValue * _sensevity;
 }