Beispiel #1
0
    void OnCollisionEnter2D(Collision2D Collider)
    {
        if (Collider.gameObject.tag.Equals("tree"))
        {
            NotDead = false;
            BlowBoxBoom box = BlowBox.GetComponent <BlowBoxBoom>();
            box.hit();
            animator.SetBool("isHit", true);
            Invoke("hitIsDone", 1f);
            LifeOfBird--;
            print("Life is: " + LifeOfBird + "coins is: " + score);
            Invoke("MoveBirdBack", 1f);
        }

        if (Collider.gameObject.tag.Equals("heal") && LifeOfBird != 3)
        {
            LifeOfBird++;
            print("Life is: " + LifeOfBird + "coins is: " + score);
        }
        if (Collider.gameObject.tag.Equals("coin"))
        {
            score++;
            print("Life is: " + LifeOfBird + "coins is: " + score);
        }
    }
Beispiel #2
0
    void hitIsDone()
    {
        animator.SetBool("isHit", false);
        BlowBoxBoom box = BlowBox.GetComponent <BlowBoxBoom>();

        box.hitIsDone();
        NotDead = true;
    }