/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/EditorPlugins/Scene/EnginePluginScene/Components/CommentComponent.cpp
55 строк
2 KB
C-Core
Visual Script Compiler Refactoring (#1526)
13 апр 2025, 22:24
Не верифицирован
13 апр 2025, 22:24
12637e3
Код
Авторство
О чём код?
#include <GameEngine/GameEnginePCH.h> #include <Core/WorldSerializer/WorldReader.h> #include <Core/WorldSerializer/WorldWriter.h> #include <EnginePluginScene/Components/CommentComponent.h> // clang-format off EZ_BEGIN_COMPONENT_TYPE(ezCommentComponent, 1, ezComponentMode::Static) { EZ_BEGIN_PROPERTIES { EZ_ACCESSOR_PROPERTY("Comment", GetComment, SetComment), } EZ_END_PROPERTIES; EZ_BEGIN_ATTRIBUTES { new ezCategoryAttribute("Editing"), } EZ_END_ATTRIBUTES; } EZ_END_DYNAMIC_REFLECTED_TYPE; // clang-format on ezCommentComponent::ezCommentComponent() = default; ezCommentComponent::~ezCommentComponent() = default; void ezCommentComponent::SetComment(const char* szText) { m_sComment.Assign(szText); } const char* ezCommentComponent::GetComment() const { return m_sComment.GetString(); } ////////////////////////////////////////////////////////////////////////// // clang-format off EZ_BEGIN_DYNAMIC_REFLECTED_TYPE(ezSceneExportModifier_RemoveCommentComponents, 1, ezRTTIDefaultAllocator<ezSceneExportModifier_RemoveCommentComponents>) EZ_END_DYNAMIC_REFLECTED_TYPE; // clang-format on void ezSceneExportModifier_RemoveCommentComponents::ModifyWorld(ezWorld& ref_world, ezStringView sDocumentType, const ezUuid& documentGuid, bool bForExport) { EZ_LOCK(ref_world.GetWriteMarker()); if (ezCommentComponentManager* pMan = ref_world.GetComponentManager<ezCommentComponentManager>()) { for (auto it = pMan->GetComponents(); it.IsValid(); it.Next()) { pMan->DeleteComponent(it); } } }