public override void SetUpInput() { DashComponent = GetComponent <DashComponent>(); AttackComponent = GetComponent <EHAttackComponent>(); MovementComponent = GetComponent <EHCharacterMovementComponent>(); CharacterWallJump = GetComponent <WallJump>(); ParryComponent = GetComponent <EHParry>(); BindActionToInput(JUMP_COMMAND, ButtonInputType.Button_Pressed, Jump); BindActionToInput(JUMP_COMMAND, ButtonInputType.Button_Buffer, JumpBufferEnded); BindActionToInput(JUMP_COMMAND, ButtonInputType.Button_Released, MovementComponent.EndJump); BindActionToInput(DASH_COMMAND, ButtonInputType.Button_Pressed, DashComponent.InputDash); BindActionToInput(DASH_COMMAND, ButtonInputType.Button_Buffer, DashComponent.CancelDash); BindActionToInput(SHOOT_COMMAND, ButtonInputType.Button_Pressed, Shoot); BindActionToInput(SHOOT_COMMAND, ButtonInputType.Button_Buffer, ShootBufferEnd); BindActionToInput(ATTACK_COMMAND, ButtonInputType.Button_Pressed, Attack); BindActionToInput(ATTACK_COMMAND, ButtonInputType.Button_Buffer, AttackBufferEnded); BindActionToInput(JUMP_COMMAND, ButtonInputType.Button_Pressed, CharacterWallJump.InputWallJump); BindActionToInput(JUMP_COMMAND, ButtonInputType.Button_Buffer, CharacterWallJump.InputCancelWallJump); BindActionToInput(PARRY_COMMAND, ButtonInputType.Button_Pressed, ParryComponent.ParryInputDown); BindActionToInput(PARRY_COMMAND, ButtonInputType.Button_Buffer, ParryComponent.ParryInputReleased); BindActionToAxis(HORIZONTAL_AXIS, MovementComponent.SetHorizontalInput); BindActionToAxis(VERTICAL_AXIS, MovementComponent.SetVerticalInput); }
private void Awake() { CharacterMovement = GetComponent <EHCharacterMovementComponent>(); CharacterCollider = GetComponent <EHBox2DCollider>(); Physics2D = GetComponent <EHPhysics2D>(); CharacterAnim = GetComponent <Animator>(); if (CharacterCollider) { CharacterCollider.OnCollision2DBegin += OnCharacterCollision; CharacterCollider.OnCollision2DEnd += OnCharacterCollisionEnd; } }
private void Awake() { MovementComponent = GetComponent <EHCharacterMovementComponent>(); DamageComponent = GetComponent <EHDamageableComponent>(); Physics2D = GetComponent <EHPhysics2D>(); CharacterAnim = GetComponent <Animator>(); MovementComponent.OnCharacterLanded += OnCharacterLanded; DashesRemaining = MaxDashesBeforeLanding; if (DamageComponent) { DamageComponent.OnCharacterHealthChanged += OnCharacterHealthChanged; } }