private void OnEnable() { Grounder = new Grounder(this); _mover = new NewMover(this); _jumper = new NewJumper(this); _playerLocker = new PlayerLocker(this); _glider = new Glider(this); _attacker = new BasicAttacker(this); Rigidbody.drag = PlayerParameters.BaseDrag; _canDash = true; Grounder.Tick(); }
private void Update() { AttackerTimer.SubtractTimer(); Grounder.Tick(); if (!(_mover is ForceMover)) { if (!_attacking && CanMove) { _mover.Tick(); if (!(_mover is Dasher)) { _jumper.Tick(); _wallJumper.Tick(); } if (Dasher.CheckDashInput()) { StartDash(); } } } else { _mover.Tick(); } _attacker.Tick(); //_attackerList.ForEach(attacker => attacker.Tick()); CheckJumping(); var isGrounded = Grounder.IsGrounded; AnimatorController.UpdateParameters(isGrounded); JustTouchedGround(isGrounded); }