1 // Copyright 2001-2018 Crytek GmbH / Crytek Group. All rights reserved.
5 #include "AudioEntitiesUtils.h"
6 #include "Legacy/Helpers/DesignerEntityComponent.h"
7 #include <CrySerialization/Decorators/ResourcesAudio.h>
9 class CAudioAreaRandom final
10 : public CDesignerEntityComponent
<>
11 , public IEntityPropertyGroup
13 CRY_ENTITY_COMPONENT_INTERFACE_AND_CLASS_GUID(CAudioAreaRandom
, "AudioAreaRandom", "8952d4d6-3e23-47d5-86ec-4724bf34789f"_cry_guid
);
16 CAudioAreaRandom() = default;
17 virtual ~CAudioAreaRandom() {}
20 virtual uint64
GetEventMask() const override
{ return CDesignerEntityComponent::GetEventMask() | BIT64(ENTITY_EVENT_ENTERNEARAREA
) | BIT64(ENTITY_EVENT_MOVENEARAREA
) | BIT64(ENTITY_EVENT_ENTERAREA
) | BIT64(ENTITY_EVENT_MOVEINSIDEAREA
) | BIT64(ENTITY_EVENT_LEAVEAREA
) | BIT64(ENTITY_EVENT_LEAVENEARAREA
); }
21 virtual void ProcessEvent(const SEntityEvent
& event
) override
;
23 virtual IEntityPropertyGroup
* GetPropertyGroup() final
{ return this; }
25 virtual void OnResetState() override
;
28 // IEntityPropertyGroup
29 virtual const char* GetLabel() const override
{ return "AudioAreaRandom Properties"; }
31 virtual void SerializeProperties(Serialization::IArchive
& archive
) override
;
32 // ~IEntityPropertyGroup
37 Vec3
GenerateOffset();
38 void UpdateFadeValue(float distance
);
40 const bool IsPlaying() const { return m_currentlyPlayingTriggerId
!= CryAudio::InvalidControlId
; }
42 CryAudio::ControlId m_playTriggerId
= CryAudio::InvalidControlId
;
43 CryAudio::ControlId m_stopTriggerId
= CryAudio::InvalidControlId
;
44 CryAudio::ControlId m_parameterId
= CryAudio::InvalidControlId
;
46 CryAudio::ControlId m_currentlyPlayingTriggerId
= CryAudio::InvalidControlId
;
48 string m_playTriggerName
;
49 string m_stopTriggerName
;
51 string m_parameterName
;
53 CryAudio::EOcclusionType m_occlusionType
= CryAudio::EOcclusionType::Ignore
;
55 bool m_bTriggerAreasOnMove
= false;
56 bool m_bMoveWithEntity
= false;
58 float m_minDelay
= 0.0f
;
59 float m_maxDelay
= 1000.0f
;
60 float m_radius
= 10.0f
;
61 float m_fadeValue
= 0.0;
62 bool m_bEnabled
= true;
63 EAreaState m_areaState
= EAreaState::Outside
;
64 float m_parameterDistance
= 5.0f
;
66 bool m_bPlaying
= false;