diff --git a/Assets/Materials/Bullet.mat b/Assets/Materials/Bullet.mat index 8e11d64..e26cb4a 100644 --- a/Assets/Materials/Bullet.mat +++ b/Assets/Materials/Bullet.mat @@ -133,7 +133,7 @@ Material: m_Colors: - _BaseColor: {r: 1, g: 1, b: 1, a: 1} - _Color: {r: 1, g: 1, b: 1, a: 1} - - _Color1: {r: 0.3634766, g: 5.3403134, b: 0, a: 1} + - _Color1: {r: 1.4539073, g: 21.361254, b: 0, a: 1} - _Color2: {r: 0.24509804, g: 0.3764706, b: 0, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _FarColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Scripts/EntityLives.cs b/Assets/Scripts/EntityLives.cs index 92e48a6..25ddd96 100644 --- a/Assets/Scripts/EntityLives.cs +++ b/Assets/Scripts/EntityLives.cs @@ -29,6 +29,8 @@ public class EntityLives : MonoBehaviour private void Die() { + FMODUnity.RuntimeManager.PlayOneShot("event:/hit"); + --lives; if (lives > 0) { diff --git a/Assets/Scripts/PlayerShootInput.cs b/Assets/Scripts/PlayerShootInput.cs index 9a9c20f..d8b2d7c 100644 --- a/Assets/Scripts/PlayerShootInput.cs +++ b/Assets/Scripts/PlayerShootInput.cs @@ -1,6 +1,10 @@ using System; +using System.Collections; +using System.Collections.Generic; +using FMOD; using UnityEngine; using UnityEngine.InputSystem; +using Debug = UnityEngine.Debug; using PlayerInput = Input.PlayerInput; public class PlayerShootInput : ShootInputBase { @@ -12,7 +16,7 @@ public class PlayerShootInput : ShootInputBase { _actions = new PlayerInput(); } - + private void OnEnable() { _actions.Enable(); @@ -25,6 +29,11 @@ public class PlayerShootInput : ShootInputBase _actions.Default.Shoot.performed -= Shoot; } + private void Start() + { + StartCoroutine(MakePewSounds()); + } + private void Shoot(InputAction.CallbackContext obj) { _isShooting = obj.ReadValueAsButton(); @@ -35,4 +44,19 @@ public class PlayerShootInput : ShootInputBase return _isShooting; } + private IEnumerator MakePewSounds() + { + var wait = new WaitForSeconds(0.02f); + + while (true) + { + if (_isShooting) + { + FMODUnity.RuntimeManager.PlayOneShot("event:/shoot"); + } + + yield return wait; + } + } + } \ No newline at end of file