Skip to content

Instantly share code, notes, and snippets.

@DaveVoyles
Created December 16, 2014 14:08
Show Gist options
  • Save DaveVoyles/53304134ab01227ce1b9 to your computer and use it in GitHub Desktop.
Save DaveVoyles/53304134ab01227ce1b9 to your computer and use it in GitHub Desktop.
// This code came from: http://hobbyistcoder.com/product/2d-shooter-bullet-weapon-system-asset-unity3d/
private void BulletPresetChangedHandler()
{
switch (BulletPreset)
{
case BulletPresetType.Simple:
bulletCount = 1;
weaponFireRate = 0.15f;
bulletSpacing = 1f;
bulletSpread = 0.05f;
bulletSpeed = 12f;
bulletRandomness = 0.15f;
break;
case BulletPresetType.GatlingGun:
bulletCount = 3;
weaponFireRate = 0.05f;
bulletSpacing = 0.25f;
bulletSpread = 0.0f;
bulletSpeed = 20f;
bulletRandomness = 0.35f;
break;
default:
// BulletPresetType.Simple
bulletCount = 1;
weaponFireRate = 0.15f;
bulletSpacing = 1f;
bulletSpread = 0.05f;
bulletSpeed = 12f;
bulletRandomness = 0.15f;
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment