Пример #1
0
 public void CancelAttack()
 {
     attackHitbox.Dettach();
     m_animator.SetTrigger("Reset");
     controller.EndAttack();
     attacking = false;
 }
Пример #2
0
    public void Jump(float customMultiplier = 0)
    {
        if (controller.actionState == PlayerPlatformer.ActionState.Attacking)
        {
            attackHitbox.Dettach();
            m_animator.SetTrigger("Reset");
            controller.EndAttack();
        }

        Instantiate(jumpStartFX, transform.position, Quaternion.identity);
        if (customMultiplier == 0)
        {
            m_rigidbody.velocity = new Vector2(m_rigidbody.velocity.x, jumpInitialSpeed);
        }
        else
        {
            m_rigidbody.velocity = new Vector2(m_rigidbody.velocity.x, jumpInitialSpeed * customMultiplier);
        }
    }