public void StartDodging() { if (heroIsDodging || (Time.time - jumpStartTime < jumpDodgeCooldownDuration)) { return; } // Enable bottom collider only fullCollider.enabled = false; bottomCollider.enabled = true; // Start dodging animation animatorController.StartDodgingAnimation(); // Change falling speed heroRigidbody.velocity = Vector2.down * jumpSpeed; // Set hero as dodging heroIsDodging = true; if (!heroIsJumping) { // Fire event: Hero started dodging //HeroStartedDodging?.Invoke(); } HeroStartedDodging?.Invoke(); }
private void RespondTo_HeroStartedDodging_Event() { HeroStartedDodging?.Invoke(); }