private void Awake() { _controlls = new Input(); _controlls.InputPad.Jump.performed += Button => Jumps(); _controlls.InputPad.Run.performed += Stick => _stickAxis = Stick.ReadValue <Vector2>(); _controlls.InputPad.Run.canceled += Stick => _stickAxis = Vector2.zero; _controlls.InputPad.JetPack.performed += Trigger => Jet(); }
private void Awake() { _map = new Inputmapping(); _map.Gamepad.StickL.performed += Stick => _moveAxis = Stick.ReadValue <Vector2>(); _map.Gamepad.StickL.canceled += Stick => _moveAxis = Vector2.zero; _map.Gamepad.StickR.performed += Stick => _aimAxis = Stick.ReadValue <Vector2>(); //_map.Gamepad.StickR.canceled += Stick => _aimAxis = Vector2.zero; _map.Gamepad.ShoulderR.performed += Button => Shoot(); _map.Gamepad.ShoulderL.performed += Button => SwitchFunction(); _map.Gamepad.DUP.performed += Button => IncreaseY(1); _map.Gamepad.DDown.performed += Button => IncreaseY(-1); _map.Gamepad.DR.performed += Button => IncreaseX(1); _map.Gamepad.DL.performed += Button => IncreaseX(-1); }
new void Awake() { base.Awake(); _controlls = new Input(); _controlls.InputPad.Jump.performed += Button => initJump(); _controlls.InputPad.Jump.canceled += Button => killJumpInit(); _controlls.InputPad.Run.performed += Stick => _stickAxis = Stick.ReadValue <Vector2>(); _controlls.InputPad.Run.canceled += Stick => _stickAxis = Vector2.zero; _controlls.InputPad.JetPack.performed += Trigger => _triggerPressed = Trigger.ReadValue <float>(); _controlls.InputPad.JetPack.canceled += Trigger => _triggerPressed = 0; _controlls.Keyboard.Jump.performed += Key => initJump(); _controlls.Keyboard.Jump.canceled += Key => killJumpInit(); _controlls.Keyboard.RunLeft.performed += LKey => _keyPressed = -LKey.ReadValue <float>(); _controlls.Keyboard.RunLeft.canceled += LKey => _keyPressed = 0; _controlls.Keyboard.RunRight.performed += RKey => _keyPressed = RKey.ReadValue <float>(); _controlls.Keyboard.RunRight.canceled += RKey => _keyPressed = 0; _controlls.Keyboard.JetPack.performed += Trigger => _triggerPressed = Trigger.ReadValue <float>(); _controlls.Keyboard.JetPack.canceled += Trigger => _triggerPressed = 0; }