using System.Collections;
using System.Collections.Generic;
#if UNITY_EDITOR 
using UnityEditor;
#endif
using UnityEngine;

namespace Assets.Source.Content.Audio
{
    [CreateAssetMenu(menuName = "Audio/Sounds/" + "Sound")]
    public class SoundInstance : ScriptableObject
    {
        public AudioClip clip;
        public FloatRange volumeRange = new FloatRange(1, 1);
        public FloatRange pitchRange = new FloatRange(1, 1);

        public AudioClip Clip => clip;
        public float Volume => Random.Range(volumeRange.min, volumeRange.max);
        public float Pitch => Random.Range(pitchRange.min, pitchRange.max);
    }

    [System.Serializable]
    public class FloatRange
    {
        public FloatRange(float _min, float _max)
        {
            min = _min;
            max = _max;
        }

        public float min, max;
    }
}
