EditorDebugDrawComponentCommon.cpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <AzCore/Serialization/SerializeContext.h>
  9. #include <AzCore/Serialization/EditContext.h>
  10. #include "EditorDebugDrawComponentCommon.h"
  11. namespace DebugDraw
  12. {
  13. EditorDebugDrawComponentSettings::EditorDebugDrawComponentSettings()
  14. : m_visibleInGame(true)
  15. , m_visibleInEditor(true)
  16. {
  17. }
  18. void EditorDebugDrawComponentSettings::Reflect(AZ::ReflectContext* context)
  19. {
  20. AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context);
  21. if (serializeContext)
  22. {
  23. serializeContext->Class<EditorDebugDrawComponentSettings>()
  24. ->Version(0)
  25. ->Field("VisibleInGame", &EditorDebugDrawComponentSettings::m_visibleInGame)
  26. ->Field("VisibleInEditor", &EditorDebugDrawComponentSettings::m_visibleInEditor)
  27. ;
  28. AZ::EditContext* editContext = serializeContext->GetEditContext();
  29. if (editContext)
  30. {
  31. editContext->Class<EditorDebugDrawComponentSettings>("DebugDraw Component Settings", "Common settings for DebugDraw components.")
  32. ->ClassElement(AZ::Edit::ClassElements::EditorData, "")
  33. ->Attribute(AZ::Edit::Attributes::Category, "Debugging")
  34. ->DataElement(0, &EditorDebugDrawComponentSettings::m_visibleInGame,
  35. "Visible In Game", "Whether this DebugDraw component is visible in game.")
  36. ->DataElement(0, &EditorDebugDrawComponentSettings::m_visibleInEditor,
  37. "Visible In Editor", "Whether this DebugDraw component is visible in editor.")
  38. ;
  39. }
  40. }
  41. }
  42. } // namespace DebugDraw