Learn / Documentation / Script Reference / SoundyDatabase

SoundyDatabase

class in Doozy.Engine.Soundy / Inherits from: ScriptableObject

Description

The SoundyDatabase is a database that contains references to SoundDatabase assets, used by Soundy to keep track and retrieve all the registered sounds

Public Variables

Public Methods

  • public bool AddSoundDatabase(SoundDatabase database, bool saveAssets) – Adds the SoundDatabase reference to this database. Returns TRUE if the operation was successful

  • public bool Contains(string databaseName) – Returns TRUE if a SoundDatabase reference, with the given database name, has been found in the database

  • public bool Contains(string databaseName, string soundName) – Returns TRUE if the given database name exists and if it contains a SoundGroupData reference with the given sound name

  • public bool CreateSoundDatabase(string databaseName, bool showDialog = false, bool saveAssets = false) – Creates a new SoundDatabase asset with the given database name and adds a reference to it to the database

  • public bool DeleteDatabase(SoundDatabase database) – Removes the given SoundDatabase reference from the database and also deletes its corresponding asset file. Returns TRUE if the operation was successful

  • public SoundGroupData GetAudioData(string databaseName, string soundName) – Returns a SoundGroupData reference from the database with the given database name and that has the given sound name. If the sound database does not exist, or no SoundGroupData with the given sound name is found, it returns null.

  • public SoundDatabase GetSoundDatabase(string databaseName) – Iterates through the database to look for the given database name to return the corresponding SoundDatabase reference. If the name does not exist, it will return null

  • public void Initialize() – Adds the ‘General’ SoundDatabase if it does not exist and initializes it

  • public void InitializeSoundDatabases() – Removes any null references and initializes all the referenced SoundDatabase found in the database

  • public void RefreshDatabase(bool performUndo = true, bool saveAssets = false) – Initializes the database and performs a refresh on all the referenced SoundDatabase assets

  • public void RemoveNullDatabases(bool saveAssets = false) – Removes any null references from the database

  • public bool RenameSoundDatabase(SoundDatabase soundDatabase,string newDatabaseName) – Renames a SoundDatabase database name (including the asset filename). Returns TRUE if the operation was successful

  • public void SearchForUnregisteredDatabases(bool saveAssets) – [Editor Only] Performs a deep search through the project for any unregistered SoundDatabase asset files and adds them to the database

  • public void SetDirty(bool saveAssets) – [Editor Only] Marks target object as dirty. (Only suitable for non-scene objects)

  • public void UndoRecord(string undoMessage) – Records any changes done on the object after this function

  • public void UpdateDatabaseNames(bool saveAssets = false) – Updates the list of SoundDatabase names found in the database