Created
November 17, 2021 02:04
-
-
Save curious-username/3f5bde6db57eaf9a1fcf96a1b7f52fd6 to your computer and use it in GitHub Desktop.
power up modification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void OnTriggerEnter2D(Collider2D other) | |
{ | |
if (other.tag == "Player") | |
{ | |
Player player = other.GetComponent<Player>(); | |
if (player != null) | |
{ | |
//if powerUp ID is 0 | |
switch (_powerupID) | |
{ | |
case 0: | |
player.TripleShotActive(); | |
break; | |
case 1: | |
player.SpeedUpActive(); | |
break; | |
case 2: | |
player.ShieldsActive(); | |
break; | |
case 3: | |
player.AmmoRefill(); | |
break; | |
case 4: | |
player.AddHealth(); | |
break; | |
case 5: | |
player.SlowDown(); | |
break; | |
case 6: | |
player.BigLaserActive(); | |
break; | |
default: | |
Debug.Log("Default Value"); | |
break; | |
} | |
Destroy(this.gameObject); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment