feat: add audio system

This commit is contained in:
2026-10-23 22:07:52 +02:00
parent a3d3da4a67
commit 0b7cc38543
28 changed files with 7412 additions and 214 deletions
+6
View File
@@ -9,6 +9,7 @@
#include <destrum/App.h>
#include <destrum/Assets/AssetTypes.h>
#include <destrum/Components/AudioSource.h>
#include <destrum/Components/MeshRendererComponent.h>
#include <destrum/Components/Physics/Collider.h>
#include <destrum/Components/Physics/Rigidbody.h>
@@ -179,6 +180,11 @@ void Editor::OnAssetDropped(std::string_view path)
}
instance->GetTransform().SetWorldPosition(spawnPosition);
scene->SetSelectedObject(instance->GetId());
} else if (AssetTypes::IsAudio(path)) {
GameObject* object = scene->CreateGameObject(name);
object->AddComponent<AudioSource>(std::string{path});
object->GetTransform().SetWorldPosition(spawnPosition);
scene->SetSelectedObject(object->GetId());
} else if (AssetTypes::IsMaterial(path)) {
GameObject* selected = scene->GetSelectedObject();
if (selected == nullptr) {