Skip to content

Instantly share code, notes, and snippets.

@DaveVoyles
Last active August 29, 2015 14:11
Show Gist options
  • Save DaveVoyles/ab3eb6e4ec9d0842142a to your computer and use it in GitHub Desktop.
Save DaveVoyles/ab3eb6e4ec9d0842142a to your computer and use it in GitHub Desktop.
/// <summary>
/// Check for pickup type and set powerup effect on the player
/// Play a particle effect when touching a player, and despawn afterwards
/// </summary>
/// <param name="other">What are we colliding with? Should only check for player</param>
private void OnTriggerEnter(Collider other)
{
if (!other.gameObject.CompareTag("Player")) return;
SpawnTextWhenTouched();
_player.weapons.PickupWeapon(1); // Picks Up Shotgun
Instantiate(_particles, transform.position, Quaternion.identity);
SoundManager.PlaySFX(_pickedUpClip);
PoolManager.Pools["BulletPool"].Despawn(transform);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment