20 lines
430 B
C++
20 lines
430 B
C++
|
|
namespace Nz
|
|
{
|
|
inline AssetCatalogAppComponent::AssetCatalogAppComponent(ApplicationBase& app)
|
|
: ApplicationComponent(app)
|
|
{
|
|
}
|
|
|
|
template<typename TResource>
|
|
Asset<TResource> AssetCatalogAppComponent::Load(std::string_view name) const
|
|
{
|
|
AssetHeaderLite header{ std::string(name), "" };
|
|
auto it = m_assets.find(header);
|
|
if (it == m_assets.end())
|
|
return {};
|
|
|
|
return Asset<TResource>::LoadFromFile(it->path);
|
|
}
|
|
}
|