35 lines
802 B
C++
35 lines
802 B
C++
#include "StaticMesh.hpp"
|
|
|
|
#include "Core/CoreInstance.hpp"
|
|
#include "Game/GameInstance.hpp"
|
|
#include "Game/SaveMap/SaveMap.hpp"
|
|
#include "Game/World/World.hpp"
|
|
|
|
StaticMesh::StaticMesh()
|
|
{
|
|
SetType(Classes::StaticMesh);
|
|
}
|
|
|
|
std::shared_ptr<SaveMap> StaticMesh::save()
|
|
{
|
|
return std::make_shared<SaveMap>("StaticMesh")->connect_to(Mesh::save());
|
|
}
|
|
|
|
void StaticMesh::load(std::shared_ptr<SaveMap> save)
|
|
{
|
|
Mesh::load(save->getParent());
|
|
}
|
|
|
|
void StaticMesh::load_model(const std::string& model_name)
|
|
{
|
|
model_name_ = model_name;
|
|
SetModelName(model_name);
|
|
model_ = GetWorld()->GetGameInstance().GetCurrentModelManager()->LoadModel(model_name);
|
|
}
|
|
|
|
void StaticMesh::OnDestroy()
|
|
{
|
|
Mesh::OnDestroy();
|
|
GetWorld()->GetGameInstance().GetCurrentModelManager()->FreeModel(model_name_);
|
|
}
|