feat: expand editor scripting asset and viewport flow
This commit is contained in:
@@ -82,13 +82,20 @@ public:
|
||||
void Publish(const T& event) {
|
||||
static_assert(sizeof(T) > 0, "Event type must be defined");
|
||||
uint32_t typeId = EventTypeId<T>::Get();
|
||||
|
||||
std::shared_lock<std::shared_mutex> lock(m_mutex);
|
||||
auto it = m_handlers.find(typeId);
|
||||
if (it != m_handlers.end()) {
|
||||
for (const auto& entry : it->second) {
|
||||
entry.handler(&event);
|
||||
|
||||
std::vector<HandlerEntry> handlers;
|
||||
{
|
||||
std::shared_lock<std::shared_mutex> lock(m_mutex);
|
||||
auto it = m_handlers.find(typeId);
|
||||
if (it == m_handlers.end()) {
|
||||
return;
|
||||
}
|
||||
|
||||
handlers = it->second;
|
||||
}
|
||||
|
||||
for (const auto& entry : handlers) {
|
||||
entry.handler(&event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user