Fixed asset creation broken logic loop
This commit is contained in:
parent
7ed5279f8c
commit
220e1a7d8b
|
@ -11,6 +11,10 @@
|
|||
#pragma once
|
||||
#include "SHAssetLoader.h"
|
||||
|
||||
#include "Assets/Asset Types/SHPrefabAsset.h"
|
||||
#include "Assets/Asset Types/SHSceneAsset.h"
|
||||
#include "Assets/Asset Types/SHMaterialAsset.h"
|
||||
|
||||
namespace SHADE
|
||||
{
|
||||
struct SHTextBasedLoader : SHAssetLoader
|
||||
|
|
|
@ -151,19 +151,26 @@ namespace SHADE
|
|||
****************************************************************************/
|
||||
AssetID SHAssetManager::CreateNewAsset(AssetType type, AssetName name) noexcept
|
||||
{
|
||||
SHAssetData* data = nullptr;
|
||||
std::string newPath{ ASSET_ROOT };
|
||||
switch (type)
|
||||
{
|
||||
case AssetType::PREFAB:
|
||||
newPath += PREFAB_FOLDER;
|
||||
auto prefab = new SHPrefabAsset();
|
||||
data = prefab;
|
||||
break;
|
||||
|
||||
case AssetType::SCENE:
|
||||
newPath += SCENE_FOLDER;
|
||||
auto scene = new SHSceneAsset();
|
||||
data = scene;
|
||||
break;
|
||||
|
||||
case AssetType::MATERIAL:
|
||||
newPath += MATERIAL_FOLDER;
|
||||
auto material = new SHMaterialAsset();
|
||||
data = material;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -189,6 +196,8 @@ namespace SHADE
|
|||
)
|
||||
});
|
||||
|
||||
assetData.emplace(id, data);
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue