Giter VIP home page Giter VIP logo

easysoundmanager's Introduction

EasySoundManager

An easy sound manager to use in any Unity project This script was created by BlackSentryDev for learning purposes. Do not sell this script!!

Anyways thanks for checking this out. To use this sound manager in your project, simply create a new gameobject and attach this script.

  • In the inspector, you'll see the option to set a Global Volume for Background sounds (Global volumes don't affect SFX)
  • The two bool variables (Can play BG and Can Play SFX) are made public so that you can easily call them in other scripts if you want to mute BG or SFX
  • In the inspector, you have to set the number of sounds you would like to play.
  • In each sound, you can set the sound type, sound Name, Sound Clip, Volume, Pitch, Loop, Global Volume, Random Volume and Random Pitch.
  • I recommend that the volume is set to 0.7
  • I also recommend that pitch is set to 1
  • Depending on the type of game, you can set random volumes and pitch if you want.

SCRIPTING--------------------------------------------------------------------------------------------------------

  • You can play Background Sound (BG) from any script by calling "SoundManager.instance.PlayBGSound(name of sound)"
  • You can play any SFX sound from any script by calling SoundManager.instance.PlaySFX(name of sound)"
  • You can toggle BG from any script by calling "SoundManager.instance.ToggleBackgroundMusic()"
  • You can toggle SFX from any script by calling "SoundManager.instance.ToggleSoundFX()"
  • You can Adjust Global volume from any script by calling "SoundManager.instance.AdjustGlobalVolume(float volume)" Adjusting global volume will affect only sounds that Use global volume in inspector.
  • You can stop a specific sound from any script by calling "SoundManager.instance.StopSouund(name of sound)"
  • You can stop all Background Music by calling "SoundManager.instance.StopAllBackgroundMusic()"

EXTRA FUNCTIONS--------------------------------------------------------------------------------------------------

  • You can check if background sound is muted by by calling "SoundManager.instance.IsBackgroundMusicMuted()"
  • You can check if SFX is muted by by calling "SoundManager.instance.IsSoundFXMuted()"

easysoundmanager's People

Contributors

blacksentrydevxo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.