Class SoundComponent

Represents a sound that can be played

Hierarchy (view full)

Constructors

Properties

filePath: string
uuid: string = ...

Accessors

  • get isPlaying(): boolean
  • This readonly property aims to indicate if the sound is playing. In this first MVP It is reset to false at any update and used only to trigger the sound at the next update

    Returns boolean

    true if the sound is set to be played at the next update.

Methods

  • Loads the sound asset using the given loader. This method is implemented asynchronously so to not block the engine, as soon as the sound is loaded it will be played

    Parameters

    Returns void

  • Plays the sound if loaded and flagged for playing at the next update. Flag is reset to false at the next update.

    Returns void