From 0c78eca1bce62b4e94fc91bc9265b425609557e1 Mon Sep 17 00:00:00 2001 From: Glence Date: Sat, 1 Oct 2022 15:09:26 +0800 Subject: [PATCH] added audiosystem back in added a button for the audio --- SHADE_Application/src/Application/SBApplication.cpp | 6 +++--- SHADE_Engine/src/AudioSystem/SHAudioSystem.cpp | 4 ++-- .../src/Editor/EditorWindow/Inspector/SHEditorInspector.cpp | 6 ++++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/SHADE_Application/src/Application/SBApplication.cpp b/SHADE_Application/src/Application/SBApplication.cpp index 8abc341b..b982557c 100644 --- a/SHADE_Application/src/Application/SBApplication.cpp +++ b/SHADE_Application/src/Application/SBApplication.cpp @@ -25,7 +25,7 @@ #include "Math/Transform/SHTransformSystem.h" #include "Input/SHInputManagerSystem.h" #include "FRC/SHFramerateController.h" -//#include "AudioSystem/SHAudioSystem.h" +#include "AudioSystem/SHAudioSystem.h" #include "Scenes/SBTestScene.h" #include "Math/Transform/SHTransformComponent.h" @@ -59,7 +59,7 @@ namespace Sandbox SHADE::SHSystemManager::CreateSystem(); SHADE::SHGraphicsSystem* graphicsSystem = static_cast(SHADE::SHSystemManager::GetSystem()); SHADE::SHSystemManager::CreateSystem(); - //SHADE::SHSystemManager::CreateSystem(); + SHADE::SHSystemManager::CreateSystem(); // Create Routines SHADE::SHSystemManager::RegisterRoutine(); @@ -95,7 +95,7 @@ namespace Sandbox auto id2 = SHFamilyID::GetID(); auto id3 = SHFamilyID::GetID(); - //SHADE::SHSystemManager::RegisterRoutine(); + SHADE::SHSystemManager::RegisterRoutine(); // Set up graphics system and windows graphicsSystem->SetWindow(&window); diff --git a/SHADE_Engine/src/AudioSystem/SHAudioSystem.cpp b/SHADE_Engine/src/AudioSystem/SHAudioSystem.cpp index be9ee832..2482fe8e 100644 --- a/SHADE_Engine/src/AudioSystem/SHAudioSystem.cpp +++ b/SHADE_Engine/src/AudioSystem/SHAudioSystem.cpp @@ -93,8 +93,8 @@ namespace SHADE void SHADE::SHAudioSystem::Run(float dt) { static_cast(dt); - if (GetKeyState(VK_SPACE) & 0x8000) - PlayEventOnce("event:/Characters/sfx_footsteps_raccoon"); + //if (GetKeyState(VK_SPACE) & 0x8000) + // PlayEventOnce("event:/Characters/sfx_footsteps_raccoon"); fmodStudioSystem->update(); if (!denseListener->empty()) diff --git a/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorInspector.cpp b/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorInspector.cpp index 25d3d955..35836dc2 100644 --- a/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorInspector.cpp +++ b/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorInspector.cpp @@ -45,6 +45,12 @@ namespace SHADE SHEditorWindow::Update(); if (Begin()) { + if (ImGui::Button("AUDIO")) + { + auto audioSystem = SHSystemManager::GetSystem(); + audioSystem->PlayEventOnce("event:/Characters/sfx_footsteps_raccoon"); + } + if (!SHEditor::selectedEntities.empty()) { EntityID const& eid = SHEditor::selectedEntities[0];