Corgi Engine  v8.8
MoreMountains.InventoryEngine.InventorySoundPlayer Class Reference

A component that will handle the playing of songs when paired with an InventoryDisplay More...

Inheritance diagram for MoreMountains.InventoryEngine.InventorySoundPlayer:
MoreMountains.Tools.MMEventListener< MMInventoryEvent >

Public Types

enum  Modes { Modes.Direct, Modes.Event }
 

Public Member Functions

virtual void SetupInventorySoundPlayer ()
 Setups the inventory sound player. More...
 
virtual void PlaySound (string soundFx)
 Plays the sound specified in the parameter string More...
 
virtual void PlaySound (AudioClip soundFx, float volume)
 Plays the sound fx specified in parameters at the desired volume More...
 
virtual void OnMMEvent (MMInventoryEvent inventoryEvent)
 Catches MMInventoryEvents and acts on them, playing the corresponding sounds More...
 
- Public Member Functions inherited from MoreMountains.Tools.MMEventListener< MMInventoryEvent >
void OnMMEvent (T eventType)
 

Public Attributes

Modes Mode = Modes.Direct
 
AudioClip OpenFx
 the audioclip to play when the inventory opens More...
 
AudioClip CloseFx
 the audioclip to play when the inventory closes More...
 
AudioClip SelectionChangeFx
 the audioclip to play when moving from one slot to another More...
 
AudioClip ClickFX
 the audioclip to play when moving from one slot to another More...
 
AudioClip MoveFX
 the audioclip to play when moving an object successfully More...
 
AudioClip ErrorFx
 the audioclip to play when an error occurs (selecting an empty slot, etc) More...
 
AudioClip UseFx
 the audioclip to play when an item is used, if no other sound has been defined for it More...
 
AudioClip DropFx
 the audioclip to play when an item is dropped, if no other sound has been defined for it More...
 
AudioClip EquipFx
 the audioclip to play when an item is equipped, if no other sound has been defined for it More...
 

Protected Member Functions

virtual void Start ()
 On Start we setup our player and grab a few references for future use. More...
 
virtual void AddAudioSource ()
 Adds an audio source component if needed. More...
 
virtual void OnEnable ()
 OnEnable, we start listening to MMInventoryEvents. More...
 
virtual void OnDisable ()
 OnDisable, we stop listening to MMInventoryEvents. More...
 

Protected Attributes

string _targetInventoryName
 
string _targetPlayerID
 
AudioSource _audioSource
 

Detailed Description

A component that will handle the playing of songs when paired with an InventoryDisplay

Member Enumeration Documentation

◆ Modes

Enumerator
Direct 
Event 

Member Function Documentation

◆ AddAudioSource()

virtual void MoreMountains.InventoryEngine.InventorySoundPlayer.AddAudioSource ( )
protectedvirtual

Adds an audio source component if needed.

◆ OnDisable()

virtual void MoreMountains.InventoryEngine.InventorySoundPlayer.OnDisable ( )
protectedvirtual

OnDisable, we stop listening to MMInventoryEvents.

◆ OnEnable()

virtual void MoreMountains.InventoryEngine.InventorySoundPlayer.OnEnable ( )
protectedvirtual

OnEnable, we start listening to MMInventoryEvents.

◆ OnMMEvent()

virtual void MoreMountains.InventoryEngine.InventorySoundPlayer.OnMMEvent ( MMInventoryEvent  inventoryEvent)
virtual

Catches MMInventoryEvents and acts on them, playing the corresponding sounds

Parameters
inventoryEventInventory event.

◆ PlaySound() [1/2]

virtual void MoreMountains.InventoryEngine.InventorySoundPlayer.PlaySound ( AudioClip  soundFx,
float  volume 
)
virtual

Plays the sound fx specified in parameters at the desired volume

Parameters
soundFxSound fx.
volumeVolume.

◆ PlaySound() [2/2]

virtual void MoreMountains.InventoryEngine.InventorySoundPlayer.PlaySound ( string  soundFx)
virtual

Plays the sound specified in the parameter string

Parameters
soundFxSound fx.

◆ SetupInventorySoundPlayer()

virtual void MoreMountains.InventoryEngine.InventorySoundPlayer.SetupInventorySoundPlayer ( )
virtual

Setups the inventory sound player.

◆ Start()

virtual void MoreMountains.InventoryEngine.InventorySoundPlayer.Start ( )
protectedvirtual

On Start we setup our player and grab a few references for future use.

Member Data Documentation

◆ _audioSource

AudioSource MoreMountains.InventoryEngine.InventorySoundPlayer._audioSource
protected

◆ _targetInventoryName

string MoreMountains.InventoryEngine.InventorySoundPlayer._targetInventoryName
protected

◆ _targetPlayerID

string MoreMountains.InventoryEngine.InventorySoundPlayer._targetPlayerID
protected

◆ ClickFX

AudioClip MoreMountains.InventoryEngine.InventorySoundPlayer.ClickFX

the audioclip to play when moving from one slot to another

◆ CloseFx

AudioClip MoreMountains.InventoryEngine.InventorySoundPlayer.CloseFx

the audioclip to play when the inventory closes

◆ DropFx

AudioClip MoreMountains.InventoryEngine.InventorySoundPlayer.DropFx

the audioclip to play when an item is dropped, if no other sound has been defined for it

◆ EquipFx

AudioClip MoreMountains.InventoryEngine.InventorySoundPlayer.EquipFx

the audioclip to play when an item is equipped, if no other sound has been defined for it

◆ ErrorFx

AudioClip MoreMountains.InventoryEngine.InventorySoundPlayer.ErrorFx

the audioclip to play when an error occurs (selecting an empty slot, etc)

◆ Mode

Modes MoreMountains.InventoryEngine.InventorySoundPlayer.Mode = Modes.Direct

the mode to choose to play sounds. Direct will play an audiosource, event will call a MMSfxEvent, meant to be caught by a MMSoundManager

◆ MoveFX

AudioClip MoreMountains.InventoryEngine.InventorySoundPlayer.MoveFX

the audioclip to play when moving an object successfully

◆ OpenFx

AudioClip MoreMountains.InventoryEngine.InventorySoundPlayer.OpenFx

the audioclip to play when the inventory opens

◆ SelectionChangeFx

AudioClip MoreMountains.InventoryEngine.InventorySoundPlayer.SelectionChangeFx

the audioclip to play when moving from one slot to another

◆ UseFx

AudioClip MoreMountains.InventoryEngine.InventorySoundPlayer.UseFx

the audioclip to play when an item is used, if no other sound has been defined for it


The documentation for this class was generated from the following file: