Data Types
Choosing the appropriate data type is essential for ensuring that game data is accurately structured, efficiently stored, and correctly interpreted by both the editor and runtime systems. Each data type serves a specific purpose and is designed to represent particular kinds of values or relationships.
For instance, use the Text data type for simple string values, or the LocalizedText type when the same text must support multiple languages. For numeric data, Number is suited for decimal values, while Integer should be used for whole numbers.
When a property should be selected from a defined set of options, PickList and MultiPickList are recommended for single or multiple selections, respectively. For more complex structures, use Document to define an embedded object, or DocumentCollection to represent a list of such objects.
By selecting data types according to their intended purpose, developers can ensure better validation, clearer data organization, and more predictable behavior across tools and runtime systems.
Data Types
Data Type |
Description |
Example |
A line of text. |
“Hello, world!” |
|
A localized text for multiple languages. |
{“en-US”: “Hello”, “fr-FR”: “Bonjour”} |
|
A true/false value. |
true |
|
A time duration (days, hours, etc.). |
“1.00:00:00” |
|
A calendar date and time. |
“2017-12-27T00:00:00.000Z” |
|
A decimal number. |
3.14 |
|
A whole number. |
42 |
|
A single value from a predefined list. |
“Red” |
|
Multiple values from a predefined list. |
“Apple, Banana, Cherry” |
|
An embedded structured object. |
{ “Id”: “Sword”, “Name”: “Rusty Sword” } |
|
A list of embedded structured objects. |
[{ “Id”: “Sword”, “Name”: “Rusty Sword” }] |
|
A pointer to another document by ID. |
{ “Id”: “Sword” } |
|
A list of pointers to other documents. |
[{ “Id”: “Sword” }] |
|
A C# expression evaluated at runtime. |
“target.HP < 100” |
Sub-Types
Sub-Type |
Base Type |
Description |
Text |
A relative path to a single game asset. |
|
Text |
A group of 2, 3, or 4 decimal values (e.g., position or scale). |
|
Text |
A group of 2, 3, or 4 whole numbers. |
|
Text |
A rectangle with floating-point position and size. |
|
Text |
A rectangle with integer position and size. |
|
Text |
A reusable set of tags shared across documents. |
Use Cases and Guidance
Use Text and LocalizedText for titles, descriptions, and UI content.
Choose Integer or Number for quantities, rates, and stats.
Use Document or Reference to include structured data or link to another entity.
Use PickList or MultiPickList when the value should be selected from a known set.
Use Asset Path or Asset Path Collection when referencing assets like textures, sounds, or prefabs by path.
Use Formula to define runtime-calculated values, like damage formulas or dynamic prices.
Use Tags when multiple documents share common descriptors (e.g., “fire”, “enemy”, “magic”).