A text notation for representing Unity GameObject hierarchies. Based on the output format of the tree command, with additional syntax for components and properties.
Append / to the name.
Player/
├── Model/
└── Weapon/
Prefix with : (no space).
- Inline form: Components whose properties are all default values can be listed on a single line, comma-separated.
- Block form: When a component has non-default property values, it is written on its own line with properties as children.
- Inline and block forms may be mixed under the same GameObject.
Player/
├── :Rigidbody
│ └── mass: 80
├── :CapsuleCollider, MeshRenderer
└── :Animator
└── controller: @PlayerAC
Written as children of a component, in the form name: value. Default values are omitted.
Use the short name (Image) by default. Qualification is required only when the short name resolves to multiple types.
UI.Image→UnityEngine.UI.Image- Fully qualified names like
UnityEngine.UI.Imageare also allowed.
Ambiguous names without qualification are an error.
| Type | Example |
|---|---|
| int | 42 |
| float | 1.5 |
| bool | true / false |
| string | "hello" |
| Vector2/3/4 | (1, 2) / (1, 2, 3) |
| Quaternion | (0, 0, 0, 1) |
| Color | (1, 0, 0, 1) (RGBA) |
| enum | Continuous (serialized name) |
| Asset ref | @PlayerMat (asset name) |
| Scene ref | $Player/Head (scene path) |
| null | null |
Player/
├── :Rigidbody
│ └── mass: 80
├── :CapsuleCollider, MeshRenderer
├── :Animator
│ └── controller: @PlayerAC
├── Model/
│ ├── :Transform, SkinnedMeshRenderer
│ └── Hand/
│ └── :Transform
└── UI/
├── :Transform, Canvas, CanvasScaler, GraphicRaycaster
└── HealthBar/
├── :Transform, Image
└── Fill/
└── :Image
└── color: (1, 0, 0, 1)
Areas left for future extension:
- Nested properties: How to represent hierarchical properties like
Rigidbody.constraints.freezeRotationX. - Arrays and lists: How to represent collection properties like
AudioSource.clips(candidate:[0]: @JumpSound). - Prefab instances: A way to distinguish GameObjects that are prefab instances.
- Active state: How to represent
active: false.