Beispiel #1
0
    void OnTriggerExit2D(Collider2D collision)
    {
        //Mendapatkan komponen Witch
        Witch witch = collision.gameObject.GetComponent <Witch>();

        //Menambahkan score jika burung tidak null dan burung belum mati;
        if (witch && !witch.IsDead())
        {
            witch.AddScore(1);
        }
    }
Beispiel #2
0
    void OnTriggerExit2D(Collider2D collision)
    {
        //Mendapatkan komponen Witch
        Witch witch = collision.gameObject.GetComponent <Witch>();

        //Menambahkan score jika burung tidak null dan burung belum mati;
        if (witch && !witch.IsDead() && gameObject.activeSelf == true)
        {
            witch.AddScore(2);
            gameObject.SetActive(false);
        }
    }