Esempio n. 1
0
    private void OnTriggerEnter2D(Collider2D target)
    {
        switch (target.gameObject.tag)
        {
        case "trap":
            Destroy(target.gameObject);
            inventory.Kill();
            break;

        case "money":
            Destroy(target.gameObject);
            lg.currentSpawns--;
            inventory.CollectMoney(10);     //TODO get it from other object
            break;

        case "powerup":
            Destroy(target.gameObject);
            lg.currentSpawns--;
            inventory.ActivatePaypal();
            break;
        }
    }