Fix editor scene persistence and XC scene workflow

This commit is contained in:
2026-03-26 01:26:26 +08:00
parent 39edb0b497
commit 0651666d8c
35 changed files with 1958 additions and 256 deletions

View File

@@ -6,24 +6,30 @@
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <atomic>
#include <mutex>
#include <shared_mutex>
namespace XCEngine {
namespace Editor {
template<typename T>
struct EventTypeId {
static uint32_t Get() {
static const uint32_t id = s_nextId++;
return id;
class EventTypeRegistry {
public:
static uint32_t NextId() {
return s_nextId.fetch_add(1, std::memory_order_relaxed);
}
private:
static uint32_t s_nextId;
inline static std::atomic<uint32_t> s_nextId{0};
};
template<typename T>
uint32_t EventTypeId<T>::s_nextId = 0;
struct EventTypeId {
static uint32_t Get() {
static const uint32_t id = EventTypeRegistry::NextId();
return id;
}
};
class EventBus {
public: