A parsing error occurred when i first ran this script
using UnityEngine;
using System.Collections;
public class Gunshot : MonoBehaviour {
public AudioClip Gun;
private AudioSource source;
void Awake () {
source = GetComponent();
}
public float timeLeft = 5.0f;
public void Update()
{
timeLeft -= Time.deltaTime;
if (timeLeft <= 0.0f)
{
source.PlayOneShot(Gun,hitVol);
↧