feat: add camera culling masks

This commit is contained in:
2026-04-01 01:42:06 +08:00
parent 51736253e3
commit 0fe02fd1b4
9 changed files with 81 additions and 3 deletions

View File

@@ -317,6 +317,7 @@ void GameObject::Destroy() {
void GameObject::Serialize(std::ostream& os) const {
os << "name=" << m_name << ";";
os << "active=" << (m_activeSelf ? "1" : "0") << ";";
os << "layer=" << static_cast<uint32_t>(m_layer) << ";";
os << "id=" << m_id << ";";
os << "uuid=" << m_uuid << ";";
os << "transform=";
@@ -346,6 +347,11 @@ void GameObject::Deserialize(std::istream& is) {
is.get(val);
m_activeSelf = (val == '1');
if (is.peek() == ';') is.get();
} else if (strcmp(key, "layer") == 0) {
uint32_t layer = 0;
is >> layer;
SetLayer(static_cast<uint8_t>(layer));
if (is.peek() == ';') is.get();
} else if (strcmp(key, "id") == 0) {
is >> m_id;
if (is.peek() == ';') is.get();