/* * Copyright (c) Contributors to the Open 3D Engine Project * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #include "DebugDraw_precompiled.h" #include #include #include "DebugDrawSphereComponent.h" namespace DebugDraw { void DebugDrawSphereElement::Reflect(AZ::ReflectContext* context) { AZ::SerializeContext* serializeContext = azrtti_cast(context); if (serializeContext) { serializeContext->Class() ->Version(0) ->Field("TargetEntityId", &DebugDrawSphereElement::m_targetEntityId) ->Field("Color", &DebugDrawSphereElement::m_color) ->Field("WorldLocation", &DebugDrawSphereElement::m_worldLocation) ->Field("Radius", &DebugDrawSphereElement::m_radius) ; AZ::EditContext* editContext = serializeContext->GetEditContext(); if (editContext) { editContext->Class("DebugDraw Sphere Element Settings", "Settings for DebugDraw sphere element.") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") ->Attribute(AZ::Edit::Attributes::Category, "Debugging") ->DataElement(0, &DebugDrawSphereElement::m_color, "Color", "Display color for the line.") ->DataElement(0, &DebugDrawSphereElement::m_radius, "Radius", "The size of the sphere.") ; } } } void DebugDrawSphereComponent::Reflect(AZ::ReflectContext* context) { DebugDrawSphereElement::Reflect(context); if (AZ::SerializeContext* serialize = azrtti_cast(context)) { serialize->Class() ->Version(0) ->Field("Element", &DebugDrawSphereComponent::m_element) ; } } DebugDrawSphereComponent::DebugDrawSphereComponent(const DebugDrawSphereElement& element) : m_element(element) { m_element.m_owningEditorComponent = AZ::InvalidComponentId; } void DebugDrawSphereComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) { provided.push_back(AZ_CRC("DebugDrawSphereService", 0x15765c23)); } void DebugDrawSphereComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) { (void)incompatible; } void DebugDrawSphereComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) { (void)required; } void DebugDrawSphereComponent::GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent) { (void)dependent; } void DebugDrawSphereComponent::Init() { } void DebugDrawSphereComponent::Activate() { DebugDrawInternalRequestBus::Broadcast(&DebugDrawInternalRequestBus::Events::RegisterDebugDrawComponent, this); } void DebugDrawSphereComponent::Deactivate() { DebugDrawInternalRequestBus::Broadcast(&DebugDrawInternalRequestBus::Events::UnregisterDebugDrawComponent, this); } } // namespace DebugDraw