Beispiel #1
0
 public void Kill()
 {
     if (SoundPrefsManager.IsSoundOn())
     {
         AudioPlayer.PlaySound(deadSound);
     }
     MainGameTracker.LifeLost();
     Destroy(healthBar);
     Destroy(this.gameObject);
 }
Beispiel #2
0
    void OnTriggerEnter2D(Collider2D collide)
    {
        GameObject otherObject = collide.gameObject;

        if (otherObject.layer == 8)
        {
            Kill();
        }
        else if (otherObject.GetComponent <Umbrella>())
        {
            MainGameTracker.AddScoreRain();
            Kill();
        }
    }
Beispiel #3
0
    void OnTriggerEnter2D(Collider2D collide)
    {
        GameObject otherObject = collide.gameObject;

        if (otherObject.layer == 8)
        {
            Kill();
        }
        if (otherObject.GetComponent <Cactus>())
        {
            otherObject.GetComponent <Cactus>().Heal();
            MainGameTracker.AddScoreFert();
            Kill();
        }
    }