SimonTendo-STSharedAudioLib icon

STSharedAudioLib

A standalone Component storing Lists of AudioClips to access from different mods.

CHANGELOG

v0.0.1

  • Release

v0.0.2

  • Added method AudioListContainsAudioClip()
    • This will check if the given AudioList, SharedAudioComponent, or GameObject contains the given AudioClip
    • Optionally, a weight integer can be given to check if the found AudioClip's AudioClipWithWeight also has the given weight
  • When performing AudioListGetRandom() or AudioListGetRandomByWeight() and passing a GameObject to search, the random AudioList will now also be picked from a random SharedAudioComponent on the GameObject instead of the first found SharedAudioComponent, in case the GameObject contains multiple SharedAudioComponents
  • Fixed minor error that could occur with the GetRandomByWeight() methods in case the given AudioClips or AudioLists had no weight
  • Included a LICENSE markdown file

v0.0.3

  • Made changes to the creation of new AudioLists in GameObject overload methods:
    • AudioListCreateNew() tells GetSharedAudioComponent() to not make a new AudioList if it doesn't have any yet, since a new AudioList would be created in the SharedAudioComponent overload following right after
    • Every AudioListGet...() method now passes its own createListIfNull parameter to GetSharedAudioComponent() to create a new AudioList if the GameObject does not have a SharedAudioComponent yet, so that the following SharedAudioComponent overload will find that single newly created one
      • Additionally, AudioListGetByName() will pass its nameListToSearch to be the name of the newly created AudioList
  • Reworked AudioListCreateNew() so if it now finds an AudioList on the SharedAudioComponent that already has the given name, it will return that one as the AudioList to use, instead of creating a new AudioList with a generic name
  • Added null checks to AudioListGetRandom() and AudioListGetRandomByWeight() in case the given objectToCheck does not contain any SharedAudioComponents
    • In this case, it will add a new SharedAudioComponent using GetSharedAudioComponent(), and follow the rule of the createListIfNull change mentioned above
  • Fixed the AudioListGetNextInAllAudioLists() GameObject overload linking to itself, it now properly gets the SharedAudioComponent of the given objectToCheck using GetSharedAudioComponent(), and continues to its SharedAudioComponent overload