public override void ConfigureInputs() { Axis horizontal = new Axis(); horizontal.onAxisChange += HorizontalAxis; Axis vertical = new Axis(); vertical.onAxisChange += VerticalAxis; Axis2D leftStick = new Axis2D(horizontal, vertical); AddInput("leftStick", leftStick); Button attack = new Button(); attack.onButtonDown += OnButtonDown; attack.onButtonUp += OnButtonUp; attack.onButtonPress += OnButtonPressed; AddInput("attack", attack); Button jump = new Button(); jump.onButtonDown += () => Input.GetKeyDown(KeyCode.K); jump.onButtonUp += () => Input.GetKeyUp(KeyCode.K); jump.onButtonPress += () => Input.GetKey(KeyCode.K); AddInput("jump", jump); }
public override void Initialization() { input = controllableCharacter.GetInputModule().Get2DAxis("leftStick"); }
public override void Initialization() { input = controllableCharacter.GetInputModule().Get2DAxis(axisName); currentAimingDirection = previousDirection = defaultDirection == Direction.Left ? Vector2.left : Vector2.right; }
public void AddInput(string inputName, Axis2D axis2D) { analogAxis2D.Add(inputName, axis2D); }