private void DoFall() { if (aState != AirborneState.FALL) { aState = AirborneState.FALL; OnFall.Raise(_void); } _curVelocity += (Vector2)transform.up * (Physics2D.gravity.y * (fallMult - 1f) * Time.deltaTime); rb2D.velocity = _curVelocity; }
public void DoDash() { if (cState != CollisionState.AIR) { _dir.Set(_dir.x, 0f); } _smoothVel = Vector2.SmoothDamp(rb.velocity, _dir * (speed * speedCurve.Evaluate(_timer.PercentageDone)), ref _smoothVel, Time.deltaTime); rb.velocity = _smoothVel; if (_timer.IsDone) { isDashing = false; OnDashEnd.Raise(_void); } }