20 lines
505 B
C#
20 lines
505 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace NeonTea.Quakeball.Audio {
|
|
public class ImpactSound : MonoBehaviour {
|
|
public AudioSource Source;
|
|
public AudioClip[] Clips;
|
|
|
|
public void PlayAt(Vector3 position) {
|
|
transform.position = position;
|
|
Source.PlayOneShot(GetRandomClip());
|
|
}
|
|
|
|
private AudioClip GetRandomClip() {
|
|
return Clips[Random.Range(0, Clips.Length)];
|
|
}
|
|
}
|
|
}
|