changed fire effects and added fire sound
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[RequireComponent(typeof(AudioSource))]
|
||||
public class Shooting : MonoBehaviour
|
||||
{
|
||||
public GameObject raycast;
|
||||
@ -14,6 +14,14 @@ public class Shooting : MonoBehaviour
|
||||
private float _fireCountdown = 1f;
|
||||
|
||||
public GameObject gun;
|
||||
public AudioSource audio;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
//audio = GetComponent<AudioSource>();
|
||||
//audio.Play();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
HandleMouseButton();
|
||||
@ -25,6 +33,7 @@ public class Shooting : MonoBehaviour
|
||||
{
|
||||
_fireCountdown = 0;
|
||||
_fireCountdown += hSliderValue;
|
||||
audio.Play();
|
||||
Shoot();
|
||||
}
|
||||
_fireCountdown -= Time.deltaTime;
|
||||
|
Reference in New Issue
Block a user