Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ammo powerup
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;
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