/* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates, or * a third party where indicated. * * For complete copyright and license terms please see the LICENSE at the root of this * distribution (the "License"). All use of this software is governed by the License, * or, if provided, by the license below or the license accompanying this file. Do not * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ #include "EMotionFX_precompiled.h" #include #include #include #include #include using namespace LmbrCentral; namespace EMotionFX { namespace Integration { void EditorAnimAudioComponent::BuildGameEntity(AZ::Entity* gameEntity) { auto animAudioComponent = aznew AnimAudioComponent; gameEntity->AddComponent(animAudioComponent); for (const auto& triggerEvent : m_editorTriggerEvents) { animAudioComponent->AddTriggerEvent(triggerEvent.m_event, triggerEvent.m_trigger.m_controlName, triggerEvent.m_joint); } } void EditorAnimAudioComponent::Reflect(AZ::ReflectContext* context) { EditorAudioTriggerEvent::Reflect(context); if (auto serializeContext = azrtti_cast(context)) { serializeContext->Class() ->Version(0) ->Field("Trigger Map", &EditorAnimAudioComponent::m_editorTriggerEvents); if (auto editContext = serializeContext->GetEditContext()) { editContext->Class("Audio Animation", "Adds ability to execute audio triggers when animation events occur.") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") ->Attribute(AZ::Edit::Attributes::Category, "Audio") ->Attribute(AZ::Edit::Attributes::Icon, "Editor/Icons/Components/AudioAnimation.svg") ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Game", 0x232b318c)) ->Attribute(AZ::Edit::Attributes::AutoExpand, true) ->DataElement(AZ::Edit::UIHandlers::Default, &EditorAnimAudioComponent::m_editorTriggerEvents, "Trigger Map", "Maps the animation events to executable audio triggers."); } } } } // namespace Integration } // namespace EMotionFX