diff --git a/SHADE_Engine/src/Assets/SHAssetManager.cpp b/SHADE_Engine/src/Assets/SHAssetManager.cpp index e3578f92..aa9772dd 100644 --- a/SHADE_Engine/src/Assets/SHAssetManager.cpp +++ b/SHADE_Engine/src/Assets/SHAssetManager.cpp @@ -255,6 +255,26 @@ namespace SHADE return result; } + SHMeshAsset const* SHAssetManager::GetMesh(AssetID id) noexcept + { + if (meshCollection.find(id) == meshCollection.end()) + { + return nullptr; + } + + return &meshCollection[id]; + } + + SHTextureAsset const* SHAssetManager::GetTexture(AssetID id) noexcept + { + if (textureCollection.find(id) == textureCollection.end()) + { + return nullptr; + } + + return &textureCollection[id]; + } + /**************************************************************************** * \param Path for meta data file * \param Path for asset file diff --git a/SHADE_Engine/src/Assets/SHAssetManager.h b/SHADE_Engine/src/Assets/SHAssetManager.h index 7064d63d..50549e01 100644 --- a/SHADE_Engine/src/Assets/SHAssetManager.h +++ b/SHADE_Engine/src/Assets/SHAssetManager.h @@ -75,6 +75,8 @@ namespace SHADE static std::vector GetAllMeshes() noexcept; static std::vector GetAllTextures() noexcept; + static SHMeshAsset const* GetMesh(AssetID id) noexcept; + static SHTextureAsset const* GetTexture(AssetID id) noexcept; private: /**************************************************************************** * \brief Load resource data into memory