fixed sounds and particle system
This commit is contained in:
@ -8,7 +8,8 @@ public class Shooting : MonoBehaviour
|
||||
public GameObject raycast;
|
||||
|
||||
public GameObject firePoint;
|
||||
[SerializeField] private GameObject projectilePrefab;
|
||||
//[SerializeField] private ParticleSystem projectilePrefab;
|
||||
public ParticleSystem projectilePrefab;
|
||||
|
||||
private float hSliderValue = 0.1f;
|
||||
private float _fireCountdown = 1f;
|
||||
@ -28,6 +29,7 @@ public class Shooting : MonoBehaviour
|
||||
_fireCountdown = 0;
|
||||
_fireCountdown += hSliderValue;
|
||||
audioSource.Play();
|
||||
Instantiate(projectilePrefab, gun.transform.position, gun.transform.rotation);
|
||||
Shoot();
|
||||
}
|
||||
_fireCountdown -= Time.deltaTime;
|
||||
@ -41,7 +43,6 @@ public class Shooting : MonoBehaviour
|
||||
{
|
||||
if (hit.transform.TryGetComponent<NPC>(out var target))
|
||||
{
|
||||
Instantiate(projectilePrefab, firePoint.transform.position, firePoint.transform.rotation);
|
||||
target.GetDamage(SettingsReader.Instance.GetSettings.RifleDamage);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user