@@ -408,16 +408,20 @@ Asset* Content::LoadAsync(const StringView& path, MClass* type)
|
|||||||
|
|
||||||
Asset* Content::LoadAsync(const StringView& path, const ScriptingTypeHandle& type)
|
Asset* Content::LoadAsync(const StringView& path, const ScriptingTypeHandle& type)
|
||||||
{
|
{
|
||||||
|
// Ensure path is in a valid format
|
||||||
|
String pathNorm(path);
|
||||||
|
FileSystem::NormalizePath(pathNorm);
|
||||||
|
|
||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
if (!FileSystem::FileExists(path))
|
if (!FileSystem::FileExists(pathNorm))
|
||||||
{
|
{
|
||||||
LOG(Error, "Missing file \'{0}\'", path);
|
LOG(Error, "Missing file \'{0}\'", pathNorm);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
AssetInfo assetInfo;
|
AssetInfo assetInfo;
|
||||||
if (GetAssetInfo(path, assetInfo))
|
if (GetAssetInfo(pathNorm, assetInfo))
|
||||||
{
|
{
|
||||||
return LoadAsync(assetInfo.ID, type);
|
return LoadAsync(assetInfo.ID, type);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user