Esempio n. 1
0
    private void OnTriggerExit2D(Collider2D other)
    {
        // If we hit the sky before and now exit it, we can jump.
        if (other.tag.Equals("Sky"))
        {
            canJump = true;
        }

        // If we exit a point detecter, tell UI to increment a point.
        // However, if we exit the point detector while the bird is dying,
        // that's not a score, so the bird should flying.
        else if (other.tag.Equals("PointDetector") && birdState == BirdState.Flying)
        {
            uiBehaviour.IncrementPoints();
        }
    }