23 lines
631 B
C#
23 lines
631 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Play3DSound : MonoBehaviour
|
|
{
|
|
public eSound m_Sound = eSound.Max;
|
|
public AudioClip m_Clip;
|
|
[Range(0f, 1f)]
|
|
public float m_Volume = 0.5f;
|
|
|
|
private void OnEnable()
|
|
{
|
|
#if UNITY_EDITOR
|
|
if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "StatTest") return;
|
|
#endif
|
|
|
|
if (m_Clip != null)
|
|
SoundInfo.Ins.Play_OneShot_byDistance(m_Clip, transform.position, m_Volume);
|
|
else
|
|
SoundInfo.Ins.Play_OneShot_byDistance(m_Sound, transform.position, m_Volume);
|
|
}
|
|
} |