示例#1
0
    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();
    }
示例#2
0
 private void RespondTo_HeroStartedDodging_Event()
 {
     HeroStartedDodging?.Invoke();
 }