Show / Hide Table of Contents

Class SfxUtility

Static class useful for playing sound clips easily.

Inheritance
System.Object
SfxUtility
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: GlitchedPolygons.Utilities
Assembly: UnityScriptsLibrary.dll
Syntax
public static class SfxUtility

Methods

| Improve this Doc View Source

PlayOnSpot(Vector3, AudioClip, Single, Single, AudioRolloffMode, Single, Single)

Play a specific AudioClip at a specific location in the world (like for instance bullet impact sfx).

Declaration
public static void PlayOnSpot(Vector3 playLocation, AudioClip clip, float volume = 1F, float pitch = 1F, AudioRolloffMode rolloffMode = null, float minDistance = 1F, float maxDistance = 500F)
Parameters
Type Name Description
Vector3 playLocation

The location at which the audio clip should be played

AudioClip clip

The audio clip to play

System.Single volume

The volume at which the clip should be played

System.Single pitch

Pitch

AudioRolloffMode rolloffMode

Audio Rolloff Mode

System.Single minDistance

Within the minimum distance, the sound will be played at 100% volume. Between min and max the rolloff kicks in.

System.Single maxDistance

Listeners that are further away from the playLocation than this maximum distance value won't hear this clip

| Improve this Doc View Source

PlaySound(AudioClip, Single, Single)

Play a specific AudioClip globally (will be heard everywhere in the scene).

Declaration
public static void PlaySound(AudioClip clip, float volume = 1F, float pitch = 1F)
Parameters
Type Name Description
AudioClip clip

The AudioClip to play

System.Single volume

The volume at which the clip will be played [0 - 1]

System.Single pitch

The pitch at which the clip will be played [-3 - 3]

  • Improve this Doc
  • View Source
Back to top Generated by DocFX