Exemplo n.º 1
0
    void PickUp()
    {
        Instantiate(particles, transform.position, transform.rotation);

        switch (effect)
        {
        case effects.SLOWMO:
            Time.timeScale = 0.5f;
            AudioManager.instance.SetPitch("Music", 0.8f);
            break;

        case effects.FASTER_MOVEMENT:
            player.speed *= speedMultiplier;
            break;

        case effects.HEALTH_REGEN:
            player.health += healthGainAmount;
            break;

        case effects.UNLIMITED_DASH:
            playerDashWait  = player.dashWait;
            player.dashWait = 0;
            break;

        case effects.SHIELD:
            player.ActivateShield();
            break;

        default:
            break;
        }

        GetComponent <SpriteRenderer>().enabled = false;
        Destroy(gameObject, effectDuration);
    }