Corgi Engine v9.4
Loading...
Searching...
No Matches
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< T > MoreMountains.Tools.MMEventListenerBase

Public Types

enum  Modes { Direct , Event }

Public Member Functions

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

Public Attributes

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

Protected Member Functions

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

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

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: