Exemple #1
0
    private void DieAction(PlayerFSM player)
    {
        float direction = -player.lookingDirection;

        player.rb.velocity        = new Vector3(direction * 3f, 6f, 0);
        player.rb.constraints     = RigidbodyConstraints2D.None;
        player.rb.angularVelocity = direction * -40f;
        player.rb.gravityScale    = 2f;
        player.GetComponent <Collider2D>().enabled = false;
    }