feat: add audio system
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user