21 lines
497 B
C#
21 lines
497 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class ZombieMoan : MonoBehaviour
|
|
{
|
|
public AudioSource AudioSource;
|
|
|
|
public AudioClip[] sounds;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
AudioSource = GetComponent<AudioSource>();
|
|
//pick a random sound from the array and apply to the source
|
|
AudioSource.clip = sounds[Random.Range(0, sounds.Length-1)];
|
|
AudioSource.Play();
|
|
}
|
|
|
|
|
|
}
|