Skip to content

PlaySound.cs

Matthew Coulter edited this page Aug 17, 2022 · 1 revision

PlaySound

class/ Inherits from:MonoBehaviour

Description

This class holds all the methods that can play Sounds in different ways

Public Methods

Method Description Returns Parameters Type
Play This method calls the play SFX method from the singleton name: This is the specific sound to play void
Stop This method calls the stop SFX method from the singleton name: This is the specific sound to stop void
PlayLooped This method was intended to play a looped sound if it hasn't started playing. name: This is the specific sound to play void
PlayOnce Ensures the sound only plays once name: This is the specific sound to play void
StopLooped This method was intended to force a looped sound to stop playing. There are easier ways to achievethis but this was made for testing purposes name: This is the specific sound to stop. void
PlaySteps This was made to play the footsteps by cycling through the footstep sound array randomly void
FadeInLoop Fading into a loop (hopefully) name: This is the specific sound to fade in void
FadeOutLoop Fading out of a loop name: This is the specific sound to fade out void