This commit is contained in:
2025-05-13 05:05:49 +03:00
parent a68d9ccb42
commit 235216efe2
606 changed files with 684027 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
using UnityEngine;
using System.Collections;
public class SoundPlayer : MonoBehaviour {
public AudioClip[] sounds;
private AudioSource audioSource;
// Use this for initialization
void Start () {
audioSource = gameObject.GetComponent<AudioSource>();
if (sounds != null && audioSource != null) {
AudioClip sound = sounds[Random.Range(0, sounds.Length - 1)];
audioSource.PlayOneShot(sound);
}
}
// Update is called once per frame
void Update () {
}
}