feat: expand editor scripting asset and viewport flow

This commit is contained in:
2026-04-03 13:22:30 +08:00
parent ed8c27fde2
commit a05d0b80a2
124 changed files with 10397 additions and 1737 deletions

View File

@@ -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);
}
}