Перейти к содержимому

Audio/Volume Slider in Unity Done RIGHT | Unity Tutorial

LlamAcademy

0:00 / 0:00

Audio/Volume Slider in Unity Done RIGHT | Unity Tutorial

13 023 просмотра · 4 года назад
LlamAcademy
31,1 тыс. подписчиков
13 023 просмотра · 4 года назад
Many of you have probably tried to create a slider that manages levels of audio for different things like Sound Effects or Music volume. However the most immediately obvious ways to approach this is very, very wrong. Human perception of audio is not linear, like we'd like it to be from a coding standpoint. It's more logarithmic. In this video we'll take a look at 2 of the most common ways to approach audio sliders, then we'll look at the right way to do it. I'll also touch on how to save volume across runs of the game and how to set it up from the very launch of your game so your players can have their audio settings respected in all cases. 🔶 ALL THINGS LlamAcademy now available at: https://llamacademy.dev/support including latest tutorials, courses, ways to support, and more! Check it out 🙂 👨‍💻 Get the FULL FREE PROJECT on GitHub: https://github.com/llamacademy/audio-... 🏷️Save 25% on the ultimate C# IDE: JetBrains Rider with code LLAMACADEMY: https://www.jetbrains.com/store/?sect... 📚 Resources: 🟠 WIkipedia link as promised: https://en.wikipedia.org/wiki/Decibel... Some links may be affiliate links, which at no additional cost to you, gives me a small portion of the purchase. Chapters: 00:00 Topic Introduction & Overview 02:10 Scene Overview 02:37 AudioSlider.cs - Setting up the 3 modes 05:46 AudioSlider.cs - Saving / Loading across runs 06:21 Hooking it all together 08:30 Demo - Linear AudioSource Volume (Not Ideal) 09:20 Demo - Linear Mixer Volume (Not Ideal) 09:50 Demo - Logarithmic Mixer Volume (The RIGHT way!) 10:20 Final Thoughts