// Start is called before the first frame update void Awake() { inputs = new TussleInput(); inputs.Fighter.Move.performed += JoystickMoved; inputs.Fighter.Move.canceled += JoystickMoved; inputs.Fighter.Smash.performed += StickSmash; inputs.Fighter.Smash.canceled += StickSmash; inputs.Fighter.Attack.started += (context) => ButtonPressed(attackButton, context); inputs.Fighter.Attack.performed += (context) => ButtonPressed(attackButton, context); inputs.Fighter.Attack.canceled += (context) => ButtonPressed(attackButton, context); inputs.Fighter.Special.started += (context) => ButtonPressed(specialButton, context); inputs.Fighter.Special.performed += (context) => ButtonPressed(specialButton, context); inputs.Fighter.Special.canceled += (context) => ButtonPressed(specialButton, context); inputs.Fighter.Jump.started += (context) => ButtonPressed(jumpButton, context); inputs.Fighter.Jump.performed += (context) => ButtonPressed(jumpButton, context); inputs.Fighter.Jump.canceled += (context) => ButtonPressed(jumpButton, context); inputs.Fighter.Shield.started += (context) => ButtonPressed(shieldButton, context); inputs.Fighter.Shield.performed += (context) => ButtonPressed(shieldButton, context); inputs.Fighter.Shield.canceled += (context) => ButtonPressed(shieldButton, context); inputs.Fighter.Grab.started += (context) => ButtonPressed(grabButton, context); inputs.Fighter.Grab.performed += (context) => ButtonPressed(grabButton, context); inputs.Fighter.Grab.canceled += (context) => ButtonPressed(grabButton, context); inputs.Enable(); }
public void RemapButton() { inputs.Disable(); inputs.Fighter.Attack.PerformInteractiveRebinding() .WithControlsExcluding("Mouse") .OnMatchWaitForAnother(0.1f) .Start() .OnComplete(_ => inputs.Enable()); }
//private Player player; void Awake() { TussleInput input = new TussleInput(); input.Fighter.Smash.performed += (context) => Debug.Log($"SMAAAAAAASH! {context.ReadValue<Vector2>()}"); input.Fighter.Move.performed += OnMoveHorizontal; input.Fighter.Move.canceled += OnMoveHorizontal; input.Enable(); //player.AddInputEventDelegate(OnJumpPressed, UpdateLoopType.Update, InputActionEventType.ButtonJustPressed,"Jump"); //player.AddInputEventDelegate(OnJumpReleased, UpdateLoopType.Update, InputActionEventType.ButtonJustReleased, "Jump"); //player.AddInputEventDelegate(OnMoveHorizontal, UpdateLoopType.Update, InputActionEventType.AxisActiveOrJustInactive, "MovementHorizontal"); }