SoundService & SoundInstance

Basic implementation. More work needs to be done.
This commit is contained in:
Modnark
2022-10-11 21:16:14 -04:00
parent d2f3e718a7
commit d269b360ce
9 changed files with 225 additions and 8 deletions

View File

@@ -518,15 +518,17 @@ void PartInstance::onTouch()
break;
}
SoundService* sndService = g_dataModel->getSoundService();
switch(OnTouchSound)
{
case Enum::Sound::NoSound:
break;
case Enum::Sound::Victory:
AudioPlayer::playSound(GetFileInPath("/content/sounds/victory.wav"));
sndService->playSound(dynamic_cast<SoundInstance*>(sndService->findFirstChild("Victory")));
break;
case Enum::Sound::Boing:
AudioPlayer::playSound(GetFileInPath("/content/sounds/boing.wav"));
sndService->playSound(dynamic_cast<SoundInstance*>(sndService->findFirstChild("Boing")));
break;
}
}