docs: sync rendering pass execution docs

This commit is contained in:
2026-04-03 15:10:37 +08:00
parent d4afa022c1
commit 19bd38ab15
59 changed files with 1544 additions and 420 deletions

View File

@@ -8,7 +8,14 @@ namespace Components {
GameObject::ID GameObject::s_nextID = 1;
GameObject::GameObject()
: m_name("GameObject") {
: m_name("GameObject")
, m_tag("Untagged")
, m_activeSelf(true)
, m_started(false)
, m_layer(0)
, m_parent(nullptr)
, m_scene(nullptr)
, m_transform(nullptr) {
m_id = s_nextID++;
static std::random_device rd;
static std::mt19937_64 gen(rd());
@@ -19,7 +26,14 @@ GameObject::GameObject()
}
GameObject::GameObject(const std::string& name)
: m_name(name) {
: m_name(name)
, m_tag("Untagged")
, m_activeSelf(true)
, m_started(false)
, m_layer(0)
, m_parent(nullptr)
, m_scene(nullptr)
, m_transform(nullptr) {
m_id = s_nextID++;
static std::random_device rd;
static std::mt19937_64 gen(rd());
@@ -212,7 +226,7 @@ std::vector<GameObject*> GameObject::FindGameObjectsWithTag(const std::string& t
auto& registry = GetGlobalRegistry();
std::vector<GameObject*> result;
for (auto& pair : registry) {
if (pair.second->GetName() == tag) {
if (pair.second->CompareTag(tag)) {
result.push_back(pair.second);
}
}
@@ -316,6 +330,7 @@ void GameObject::Destroy() {
void GameObject::Serialize(std::ostream& os) const {
os << "name=" << m_name << ";";
os << "tag=" << m_tag << ";";
os << "active=" << (m_activeSelf ? "1" : "0") << ";";
os << "layer=" << static_cast<uint32_t>(m_layer) << ";";
os << "id=" << m_id << ";";
@@ -342,6 +357,10 @@ void GameObject::Deserialize(std::istream& is) {
if (strcmp(key, "name") == 0) {
std::getline(is, m_name, ';');
} else if (strcmp(key, "tag") == 0) {
std::string tag;
std::getline(is, tag, ';');
SetTag(tag);
} else if (strcmp(key, "active") == 0) {
char val;
is.get(val);