feat: Add Camera component / Add cooked model and texture loading
This commit is contained in:
@@ -297,6 +297,9 @@ bool SceneSerializer::Save(Scene& scene, const std::filesystem::path& path) {
|
||||
root["version"] = 2;
|
||||
root["name"] = scene.GetName();
|
||||
root["objects"] = json::array();
|
||||
if (scene.m_CurrentCameraId != InvalidObjectId) {
|
||||
root["currentCamera"] = scene.m_CurrentCameraId;
|
||||
}
|
||||
|
||||
for (const auto& objectPtr : scene.GetObjects()) {
|
||||
if (!objectPtr || objectPtr->IsBeingDestroyed()) {
|
||||
@@ -569,6 +572,7 @@ bool SceneSerializer::ConstructScene(Scene& scene, LoadResult& result,
|
||||
if (root.contains("name")) {
|
||||
scene.m_name = root.at("name").get<std::string>();
|
||||
}
|
||||
scene.m_CurrentCameraId = root.value("currentCamera", InvalidObjectId);
|
||||
|
||||
if (progressCallback) progressCallback(0.9f);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user