added audiosystem back in

added a button for the audio
This commit is contained in:
Glence 2022-10-01 15:09:26 +08:00
parent 8ad315193d
commit 0c78eca1bc
3 changed files with 11 additions and 5 deletions

View File

@ -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::SHTransformSystem>();
SHADE::SHGraphicsSystem* graphicsSystem = static_cast<SHADE::SHGraphicsSystem*>(SHADE::SHSystemManager::GetSystem<SHADE::SHGraphicsSystem>());
SHADE::SHSystemManager::CreateSystem<SHADE::SHInputManagerSystem>();
//SHADE::SHSystemManager::CreateSystem<SHADE::SHAudioSystem>();
SHADE::SHSystemManager::CreateSystem<SHADE::SHAudioSystem>();
// Create Routines
SHADE::SHSystemManager::RegisterRoutine<SHADE::SHScriptEngine, SHADE::SHScriptEngine::FrameSetUpRoutine>();
@ -95,7 +95,7 @@ namespace Sandbox
auto id2 = SHFamilyID<SHSystem>::GetID<SHGraphicsSystem>();
auto id3 = SHFamilyID<SHSystem>::GetID<SHGraphicsSystem>();
//SHADE::SHSystemManager::RegisterRoutine<SHADE::SHAudioSystem, SHADE::SHAudioSystem::AudioRoutine>();
SHADE::SHSystemManager::RegisterRoutine<SHADE::SHAudioSystem, SHADE::SHAudioSystem::AudioRoutine>();
// Set up graphics system and windows
graphicsSystem->SetWindow(&window);

View File

@ -93,8 +93,8 @@ namespace SHADE
void SHADE::SHAudioSystem::Run(float dt)
{
static_cast<void>(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())

View File

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