diff --git a/Assets/Audio/Effects/crossbow shot.mp3 b/Assets/Audio/Effects/crossbow shot.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..73f5666789fcbe06fafec7b9e51bea526250becb --- /dev/null +++ b/Assets/Audio/Effects/crossbow shot.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b3a84980ea5cba678a51b4801d0ad8fe2613c54f9ff0aea9f49bd65b075e46b +size 16320 diff --git a/Assets/Audio/Effects/crossbow shot.mp3.meta b/Assets/Audio/Effects/crossbow shot.mp3.meta new file mode 100644 index 0000000000000000000000000000000000000000..90c7c7ab55820b8fff36d1dc0d19648e1071225b --- /dev/null +++ b/Assets/Audio/Effects/crossbow shot.mp3.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 1f660a7f70aaaf94e94019c8a23e3114 +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/BowShooting.cs b/Assets/BowShooting.cs index 30397189ecd6db4c0f1af5d8fce9120269ed3bd7..4e01728f366d0ffaf9fde469679441eadf12f79e 100644 --- a/Assets/BowShooting.cs +++ b/Assets/BowShooting.cs @@ -14,9 +14,11 @@ public class BowShooting : MonoBehaviour public float maxRotation; public float angle; private bool fire; + AudioSource audioSource; void Start() { + audioSource = GetComponent<AudioSource>(); firePowerSpeed = 5; bow.Reload(); } @@ -33,11 +35,12 @@ public class BowShooting : MonoBehaviour } if (fire && firePowerSpeed < maxPower) { - firePowerSpeed += Time.deltaTime * firePowerSpeed; + firePowerSpeed += Time.deltaTime * firePowerSpeed/2; } if (fire && Input.GetButtonUp("Fire1")) { bow.Shoot(firePowerSpeed); + audioSource.Play(); firePowerSpeed = 0; fire = false; } diff --git a/Assets/WeaponHandling.cs b/Assets/WeaponHandling.cs index d4e073be476a79ec6197f60ab387774c2580aabe..3dd18ef142d8d2aa3c2cdacb8a609b53cfc9830b 100644 --- a/Assets/WeaponHandling.cs +++ b/Assets/WeaponHandling.cs @@ -19,6 +19,34 @@ public class WeaponHandling : MonoBehaviour // Update is called once per frame void Update() { + if (weaponIdx == 0){ + Rifle.SetActive(true); + RifleEnd.SetActive(true); + Shotgun.SetActive(false); + Bow.SetActive(false); + Sword.SetActive(false); + } + else if (weaponIdx == 1){ + Rifle.SetActive(false); + RifleEnd.SetActive(false); + Shotgun.SetActive(true); + Bow.SetActive(false); + Sword.SetActive(false); + } + else if (weaponIdx == 2){ + Rifle.SetActive(false); + RifleEnd.SetActive(false); + Shotgun.SetActive(false); + Bow.SetActive(false); + Sword.SetActive(true); + } + else if (weaponIdx == 3){ + Rifle.SetActive(false); + RifleEnd.SetActive(false); + Shotgun.SetActive(false); + Bow.SetActive(true); + Sword.SetActive(false); + } if (Input.GetKeyDown("1")) { weaponIdx = 0;