Unity library to setup and play 2D sound in a more convenient way: no need to attach a AudioSource component, all is managed in the background.
Simply import this package with Unity Package Manager by using the url https://github.com/sgaumin/AudioExpress.git
Unity 2018.4 or later versions. Don't forget to include the AudioExpress namespace.
From the inspector, we can assign audio clip and edit parameters
If you follow the hierarchy Assets/Sounds/Audio Mixer.mixer, mixer group will be automatically attached as well. Just make sure that the audio clip and the mixer group share the same name.
In the scene, Audio Units are automatically created and rearranged under an object called AudioParent
using AudioExpress
public class PlayerController : MonoBehaviour
{
[Header("Audio")]
[SerializeField] private AudioConfig movementSound;
public void Move()
{
movementSound.Play();
}
}