예제 #1
0
    void OnTriggerEnter2D(Collider2D col)
    {
        if (col.tag == "Player")
        {
            switch (pickUp)
            {
            case pickUpTypes.LIFE:
                ScoreManager.AddLife();
                Destroy(gameObject);

                break;

            case pickUpTypes.SHOTGUN:
                shootScript.ChangeWeaponType(PlayerShooting.WeaponTypes.Shotgun);
                powerUpManager.setPowerText("Spreading Virus");
                powerUpManager.setPowerSlider();
                Destroy(gameObject);

                break;

            case pickUpTypes.TRISHOT:
                shootScript.ChangeWeaponType(PlayerShooting.WeaponTypes.TriGun);
                powerUpManager.setPowerText("Tripple Virus");
                powerUpManager.setPowerSlider();
                Destroy(gameObject);

                break;

            case pickUpTypes.GRENADE:
                //Grenade
                break;
            }
            if (audioScript)
            {
                audioScript.PowerUpObtained(transform.position);
            }
        }
    }