EditorAudioTriggerComponent.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. #pragma once
  9. #include <IAudioSystem.h>
  10. #include <AzCore/std/string/string.h>
  11. #include <AzToolsFramework/ToolsComponents/EditorComponentBase.h>
  12. #include <AzToolsFramework/UI/PropertyEditor/PropertyAudioCtrlTypes.h>
  13. #include "AudioTriggerComponent.h"
  14. namespace LmbrCentral
  15. {
  16. /*!
  17. * EditorAudioTriggerComponent
  18. */
  19. class EditorAudioTriggerComponent
  20. : public AzToolsFramework::Components::EditorComponentBase
  21. {
  22. public:
  23. AZ_EDITOR_COMPONENT(EditorAudioTriggerComponent, "{E8A7656C-6146-427C-B592-25514EEEF841}",
  24. AzToolsFramework::Components::EditorComponentBase);
  25. EditorAudioTriggerComponent();
  26. void BuildGameEntity(AZ::Entity* gameEntity) override;
  27. void SetObstructionType(Audio::ObstructionType) {}
  28. static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
  29. {
  30. LmbrCentral::AudioTriggerComponent::GetProvidedServices(provided);
  31. }
  32. static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required)
  33. {
  34. LmbrCentral::AudioTriggerComponent::GetRequiredServices(required);
  35. }
  36. static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
  37. {
  38. LmbrCentral::AudioTriggerComponent::GetIncompatibleServices(incompatible);
  39. }
  40. static void Reflect(AZ::ReflectContext* context);
  41. private:
  42. //! Serialized data
  43. AzToolsFramework::CReflectedVarAudioControl m_defaultPlayTrigger;
  44. AzToolsFramework::CReflectedVarAudioControl m_defaultStopTrigger;
  45. Audio::ObstructionType m_obstructionType = Audio::ObstructionType::Ignore;
  46. bool m_playsImmediately = false;
  47. };
  48. } // namespace LmbrCentral