21 lines
497 B
C#
Raw Normal View History

2025-09-06 17:17:39 +04:00
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();
}
}