35 lines
625 B
C++
35 lines
625 B
C++
#include <components/PrintComponent.h>
|
|
|
|
#include "spdlog/spdlog.h"
|
|
|
|
PrintComponent::PrintComponent(GameObject& parent) : Component(parent, "PrintComponent")
|
|
{
|
|
}
|
|
|
|
void PrintComponent::Start()
|
|
{
|
|
}
|
|
|
|
void PrintComponent::Update(float dt)
|
|
{
|
|
spdlog::debug(m_message);
|
|
}
|
|
|
|
void PrintComponent::ImGuiInspector()
|
|
{
|
|
Component::ImGuiInspector();
|
|
}
|
|
|
|
nlohmann::json PrintComponent::Serialize() const
|
|
{
|
|
return {"message", m_message};
|
|
}
|
|
|
|
void PrintComponent::Deserialize(const nlohmann::json& basic_jsons)
|
|
{
|
|
if (basic_jsons.contains("message"))
|
|
{
|
|
m_message = basic_jsons.at("message").get<std::string>();
|
|
}
|
|
}
|