File tree Expand file tree Collapse file tree 3 files changed +33
-2
lines changed Expand file tree Collapse file tree 3 files changed +33
-2
lines changed Original file line number Diff line number Diff line change 12
12
#pragma once
13
13
14
14
#include < CsvSpawner/CsvSpawnerUtils.h>
15
+
15
16
#include < AzCore/EBus/EBus.h>
17
+ #include < AzCore/RTTI/BehaviorContext.h>
16
18
17
19
namespace CsvSpawner
18
20
{
@@ -52,4 +54,26 @@ namespace CsvSpawner
52
54
// Create an EBus using the notification interface
53
55
using CsvSpawnerNotificationBus = AZ::EBus<CsvSpawnerInterface>;
54
56
57
+ class CsvSpawnerNotificationBusHandler
58
+ : public CsvSpawnerNotificationBus::Handler
59
+ , public AZ::BehaviorEBusHandler
60
+ {
61
+ public:
62
+ AZ_EBUS_BEHAVIOR_BINDER (
63
+ CsvSpawnerNotificationBusHandler,
64
+ CsvSpawnerNotificationBusHandlerTypeId,
65
+ AZ::SystemAllocator,
66
+ OnEntitiesSpawnBegin,
67
+ OnEntitiesSpawnFinished);
68
+
69
+ void OnEntitiesSpawnBegin (CsvSpawnerUtils::SpawnInfo& m_spawnInfo) override
70
+ {
71
+ Call (FN_OnEntitiesSpawnBegin, m_spawnInfo);
72
+ }
73
+
74
+ void OnEntitiesSpawnFinished (CsvSpawnerUtils::SpawnInfo& m_spawnInfo, CsvSpawnerUtils::SpawnStatus& m_statusCode) override
75
+ {
76
+ Call (FN_OnEntitiesSpawnFinished, m_spawnInfo, m_statusCode);
77
+ }
78
+ };
55
79
} // namespace CsvSpawner
Original file line number Diff line number Diff line change @@ -22,5 +22,6 @@ namespace CsvSpawner
22
22
23
23
// Interface TypeIds
24
24
inline constexpr const char * CsvSpawnerInterfaceTypeId = " {77ACBD4E-069E-4610-8154-E1AC28CEE05A}" ;
25
+ inline constexpr const char * CsvSpawnerNotificationBusHandlerTypeId = " {1F142F00-4E79-431B-9C1D-3AB157838FF8}" ;
25
26
inline constexpr const char * CsvSpawnerSpawnInfoTypeId = " {81E5A014-3232-4359-98F5-7F9D7152629E}" ;
26
27
} // namespace CsvSpawner
Original file line number Diff line number Diff line change 9
9
*/
10
10
11
11
#include " CsvSpawnerEditorComponent.h"
12
- #include " AzCore/Debug/Trace.h"
13
12
#include " CsvSpawnerComponent.h"
14
13
#include " CsvSpawnerCsvParser.h"
15
14
#include " CsvSpawnerUtils.h"
15
+ #include < CsvSpawner/CsvSpawnerInterface.h>
16
16
17
17
#include < AzCore/Component/TransformBus.h>
18
+ #include < AzCore/Debug/Trace.h>
18
19
#include < AzCore/IO/Path/Path.h>
19
20
#include < AzCore/Serialization/EditContext.h>
20
21
#include < AzFramework/Physics/Common/PhysicsTypes.h>
21
22
#include < AzToolsFramework/API/EditorAssetSystemAPI.h>
22
23
#include < AzToolsFramework/Viewport/ViewportMessages.h>
23
- #include < thread>
24
24
25
25
namespace CsvSpawner
26
26
{
@@ -63,6 +63,12 @@ namespace CsvSpawner
63
63
->Attribute (AZ::Edit::Attributes::ChangeNotify, &CsvSpawnerEditorComponent::OnOnShowLabelsChanged);
64
64
}
65
65
}
66
+
67
+ if (const auto behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
68
+ {
69
+ behaviorContext->EBus <CsvSpawner::CsvSpawnerNotificationBus>(" CsvSpawnerNotificationBus" )
70
+ ->Handler <CsvSpawner::CsvSpawnerNotificationBusHandler>();
71
+ }
66
72
}
67
73
68
74
void CsvSpawnerEditorComponent::OnOnShowLabelsChanged ()
You can’t perform that action at this time.
0 commit comments