Fixed Serializer
- Fixed Serializer skipping entities with id 0 - EditorLayer now serializes the scene upon destruction
This commit is contained in:
parent
8447e5dab2
commit
924875d12e
4 changed files with 2006 additions and 2489 deletions
|
@ -91,7 +91,7 @@ namespace Light {
|
|||
m_Scene->m_Registry.each([&](auto entityID)
|
||||
{
|
||||
Entity entity = { entityID, m_Scene.get() };
|
||||
if (!entity)
|
||||
if (!entity.IsValid())
|
||||
return;
|
||||
|
||||
SerializeEntity(out, entity);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -19,6 +19,12 @@ namespace Light {
|
|||
|
||||
m_CameraEntity = m_Scene->GetEntityByTag("Game Camera");
|
||||
}
|
||||
|
||||
EditorLayer::~EditorLayer()
|
||||
{
|
||||
SceneSerializer serializer(m_Scene);
|
||||
serializer.Serialize("../../Mirror/res/Scenes/editorlayer.yaml");
|
||||
}
|
||||
|
||||
void EditorLayer::OnUpdate(float deltaTime)
|
||||
{
|
||||
|
|
|
@ -29,6 +29,7 @@ namespace Light {
|
|||
|
||||
public:
|
||||
EditorLayer(const std::string& name);
|
||||
~EditorLayer();
|
||||
|
||||
void OnUpdate(float deltaTime) override;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue