public AudioClip GetClip(EAudioEventType eventType)
        {
            if (!_clips.TryGetValue(eventType, out var clip))
            {
                UnityEngine.Debug.LogError($"{this}: event '{eventType}' clip was not found");
            }

            return(clip);
        }
    public void PlaySound(EAudioEventType type)
    {
        var settingsForEvent = settings.settingsForEventType(type);

        PoolManager.Instance.ReuseObject(prefab.gameObject, transform.position, Quaternion.identity, settingsForEvent);
    }
    public void PlaySoundAtPosition(EAudioEventType type, Vector3 position)
    {
        var settingsForEvent = settings.settingsForEventType(type);

        PoolManager.Instance.ReuseObject(prefab.gameObject, position, Quaternion.identity, settingsForEvent);
    }
 public static void PlaySound(EAudioEventType type, Vector3 position)
 {
     _instance.PlaySoundAtPosition(type, position);
 }
 public void ReportEvent(EAudioEventType eventType)
 {
     _audioSource.PlayOneShot(_clipProvider.GetClip(eventType));
 }
Exemple #6
0
 public AudioSetting settingsForEventType(EAudioEventType type)
 {
     return(_settings [type]);
 }