51 lines
1.5 KiB
C#
51 lines
1.5 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Audio_animation : MonoBehaviour
|
|
{
|
|
public float pitch_min;
|
|
public float pitch_max;
|
|
public AudioClip[] Sounds_AR;
|
|
public float pitch_min_2;
|
|
public float pitch_max_2;
|
|
public AudioClip[] Sounds_AR_2;
|
|
public float pitch_min_3;
|
|
public float pitch_max_3;
|
|
public AudioClip[] Sounds_AR_3;
|
|
public float pitch_min_4;
|
|
public float pitch_max_4;
|
|
public AudioClip[] Sounds_AR_4;
|
|
public AudioClip[] Sounds_UI;
|
|
private AudioSource audioSource;
|
|
private void Start()
|
|
{
|
|
audioSource = GetComponent<AudioSource>();
|
|
}
|
|
|
|
public void sound_play()
|
|
{
|
|
audioSource.pitch = Random.Range(pitch_min, pitch_max);
|
|
audioSource.PlayOneShot(Sounds_AR[Random.Range(0, Sounds_AR.Length)]);
|
|
}
|
|
public void sound_play_2()
|
|
{
|
|
audioSource.pitch = Random.Range(pitch_min_2, pitch_max_2);
|
|
audioSource.PlayOneShot(Sounds_AR_2[Random.Range(0, Sounds_AR_2.Length)]);
|
|
}
|
|
public void sound_play_3()
|
|
{
|
|
audioSource.pitch = Random.Range(pitch_min_3, pitch_max_3);
|
|
audioSource.PlayOneShot(Sounds_AR_3[Random.Range(0, Sounds_AR_3.Length)]);
|
|
}
|
|
public void sound_play_4()
|
|
{
|
|
audioSource.pitch = Random.Range(pitch_min_4, pitch_max_4);
|
|
audioSource.PlayOneShot(Sounds_AR_4[Random.Range(0, Sounds_AR_4.Length)]);
|
|
}
|
|
public void sound_play_UI()
|
|
{
|
|
audioSource.PlayOneShot(Sounds_UI[Random.Range(0, Sounds_UI.Length)]);
|
|
}
|
|
}
|