annotations
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
annotations [2021/12/06 14:23] – created maxime | annotations [2021/12/10 11:33] – maxime | ||
---|---|---|---|
Line 8: | Line 8: | ||
<code lua> | <code lua> | ||
- | mod:createData({ | + | foundation.createData({ |
DataType = " | DataType = " | ||
ResourceNeededList = { -- list of RESOURCE_COLLECTION_VALUE | ResourceNeededList = { -- list of RESOURCE_COLLECTION_VALUE | ||
Line 27: | Line 27: | ||
} | } | ||
}) | }) | ||
+ | </ | ||
+ | |||
+ | === Lazy-init === | ||
+ | |||
+ | By default, components are always initialized (call of '' | ||
+ | |||
+ | <code lua> | ||
+ | local standardComp = nil | ||
+ | local lazyInitComp = nil | ||
+ | |||
+ | level: | ||
+ | standardComp = _newObject: | ||
+ | standardComp: | ||
+ | | ||
+ | lazyInitComp = _newObject: | ||
+ | lazyInitComp: | ||
+ | end) | ||
+ | -- at the end of createObject, | ||
+ | |||
+ | -- when enabling lazyInitComp, | ||
+ | lazyInitComp: | ||
</ | </ | ||
annotations.txt · Last modified: 2022/08/16 10:56 by maxime