annotations
This is an old revision of the document!
Table of Contents
Annotations
Type annotations
Single-property type
A type with this annotation contains only a single serialized property. Thus, to make the syntax lighter, instantiation for this type can be done by simply providing the value of the single property.
mod:createData({ DataType = "BUILDING_PART_COST", ResourceNeededList = { -- list of RESOURCE_COLLECTION_VALUE -- Can be serialized in full, like any other type { Collection = { { Resource = "WOOD", Quantity = 20 }, { Resource = "STONE", Quantity = 10 }, } }, -- Or serialized directly like its only property, a list of RESOURCE_QUANTITY_PAIR { { Resource = "WOOD", Quantity = 20 }, { Resource = "STONE", Quantity = 10 }, } } })
Property annotations
Serialized
This property is used to configure the data of assets or prefab components. For components and their data, it is saved in the savegame file, unless the component is owned by an object instantiated by a prefab, in which case it also needs to be tagged as Savegame to be saved.
Savegame
The value of this property is always saved in the savegame file.
Runtime only
This property is not used to configure an asset/component/data, but can be read and set at runtime.
annotations.1638818620.txt.gz · Last modified: 2021/12/06 14:23 by maxime