示例#1
0
    public void hardLanding()        // call this function if the balloon was damaged or it hit the ground(in other words the game is over)
    {
        landed = true;
        if (Mathf.Abs(avgVelocity) > 1.5f)
        {
            ExplosionsScript.explode();  // explode immediately
        }

        Top.GetComponent <PolygonCollider2D>().enabled = false; // turn off balloon collider for animation
        rbBalloon.angularVelocity = 0;                          // stop rotation

        // Play animations
        balloonAnimator.enabled = true;
        basketAnimator.enabled  = true;
    }