banks curr working

This commit is contained in:
Glence 2022-09-28 17:25:14 +08:00
parent 7fcac5e0eb
commit bed6a144f8
9 changed files with 15 additions and 5 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Assets/Audio/footsteps.bank Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -15,6 +15,8 @@
#include <FMOD/fmod_errors.h> #include <FMOD/fmod_errors.h>
#include <FMOD/fmod.hpp> #include <FMOD/fmod.hpp>
#include <FMOD/fmod_studio.hpp> #include <FMOD/fmod_studio.hpp>
#include <SDL_keyboard.h>
namespace SHADE namespace SHADE
{ {
SHAudioSystem::SHAudioSystem() SHAudioSystem::SHAudioSystem()
@ -79,18 +81,21 @@ namespace SHADE
LoadBank("../../Assets/Audio/Master.bank"); LoadBank("../../Assets/Audio/Master.bank");
LoadBank("../../Assets/Audio/Master.strings.bank"); LoadBank("../../Assets/Audio/Master.strings.bank");
LoadBank("../../Assets/Audio/Music.bank"); //LoadBank("../../Assets/Audio/Music.bank");
LoadBank("../../Assets/Audio/SFX.bank"); LoadBank("../../Assets/Audio/footsteps.bank");
//auto clip = CreateAudioClip("event:/Characters/sfx_footsteps_human"); //auto clip = CreateAudioClip("event:/Characters/sfx_footsteps_human");
//clip->Play(); //clip->Play();
//PlayEventOnce("event:/Characters/sfx_footsteps_human"); //PlayEventOnce("event:/Characters/sfx_footsteps_raccoon");
PlayEventOnce("event:/SFX/Dawn/Dawn_Attack"); //PlayEventOnce("event:/SFX/Dawn/Dawn_Attack");
} }
void SHADE::SHAudioSystem::Run(float dt) void SHADE::SHAudioSystem::Run(float dt)
{ {
static_cast<void>(dt); static_cast<void>(dt);
if (GetKeyState(VK_SPACE) & 0x8000)
PlayEventOnce("event:/Characters/sfx_footsteps_raccoon");
fmodStudioSystem->update(); fmodStudioSystem->update();
if (!denseListener->empty()) if (!denseListener->empty())
{ {

View File

@ -42,6 +42,11 @@ namespace SHADE
SHEditorWindow::Update(); SHEditorWindow::Update();
if (Begin()) if (Begin())
{ {
if(ImGui::Button("AUDIO"))
{
if(auto audioSystem = SHSystemManager::GetSystem<SHADE::SHAudioSystem>())
audioSystem->PlayEventOnce("event:/Characters/sfx_footsteps_raccoon");
}
if (!SHEditor::selectedEntities.empty()) if (!SHEditor::selectedEntities.empty())
{ {
EntityID const& eid = SHEditor::selectedEntities[0]; EntityID const& eid = SHEditor::selectedEntities[0];