// Must be colled to setup the class's functionality
void init()
{
// Singleton method returns a bool depending on whether this object is the instance of the class
if (SingletonUtil.TryInit(ref _instance, this, gameObject, true))
{
if (useCustomPaths)
{
loader = new AudioLoader(customJSONPath, customAudioPath);
}
else
{
loader = AudioLoader.Default;
}
fileList = loader.Load();
if (!fileList.AreEventsSubscribed)
{
fileList.SubscribeEvents();
}
fileList.PopulateGroups();
initFileDictionary(fileList);
addAudioEvents();
subscribeEvents();
if (isAudioListener)
{
addAudioListener();
}
preloadFiles(fileList.Files);
if (playMusicOnInit)
{
playMainMusic();
}
}
}