Skip to content

Instantly share code, notes, and snippets.

@modyari
Last active January 25, 2023 23:23
Show Gist options
  • Save modyari/ca545fbfbe0c5e2ff3392e771a4e600a to your computer and use it in GitHub Desktop.
Save modyari/ca545fbfbe0c5e2ff3392e771a4e600a to your computer and use it in GitHub Desktop.
public void HandlePickup(GameCharacter character)
{
DeactivatePowerUp();
hideAnimation.Play();
if (character is Player)
{
powerUpUI.Show()
soundManager.PlaySound(Sounds.PowerUp);
}
else
{
character.PlayAnimation(Animations.PowerUp);
soundManager.PlaySound(Sounds.EnemyPowerUp);
}
character.Pickup(this);
achievments.RegisterPowerUp(this);
saveManager.SaveItem(this);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment