Cocos AIR scene graph
Stop once you can answer the task. Do not read another same-topic reference for the same question.
Scope: Native Scene/Node/Component trees, lifecycle, events, layers, pooling and scene globals.
Environment: use package imports in apps; source paths require an AIR checkout. See context.
Quick Start
For complete setup and teardown, read Quick Start.
Siblings: direct dependencies; reuse loaded skills.
Triggers
- Attach, reparent, find or pool scene nodes
- Distinguish local transforms and inherited state
- Choose layers and camera visibility masks
- Unsubscribe external listeners when nodes are destroyed
- Apply scene globals and inspect effective values
- Release Scene or SceneAsset references safely
- Check component lifecycle order and dt units
Exact API and symptom mappings: triggers.
Contracts
Use native Scene/Node/Component objects. destroy() is deferred; detach external listeners explicitly and distinguish local active state from activeInHierarchy.
Read references/contracts.md only when the task needs exact option rules, limits, error behavior or source annotations. Prefer the topic references below for a narrower question.
Common Mistakes
- [HIGH] No Creator .scene/.prefab or resources-bundle pipeline exists.
- [HIGH] node.destroy() does not unsubscribe external event sources.
- [MEDIUM] Register layers instead of manually assigning their bits.
- [MEDIUM] World scale includes inherited parent transforms.
Read relevant wrong/right examples before implementation.
Reference map
- Which node operation? - Hierarchy and lifecycle
- Which layer is visible? - Bits and masks
- Which listeners survive? - Events and teardown
- When do globals apply? - Activation and refs