User Tools

Site Tools


mod-management-functions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
mod-management-functions [2021/12/09 10:45] maximemod-management-functions [2022/09/12 15:42] maxime
Line 74: Line 74:
 | //''assetId''// | ''string'' | the ID to assign to the asset | | //''assetId''// | ''string'' | the ID to assign to the asset |
 | //''assetType''// | ''string'' | optional, type of the asset | | //''assetType''// | ''string'' | optional, type of the asset |
 +
 +----
 +
 +===== registerPrefabChild =====
 +
 +Registers a new child for a prefab
 +
 +''void **myMod:registerPrefabChild**(//parentPrefabIdOrPath//, //id// [, //name//] [, //transform//])''
 +
 +^ Name ^ Type ^ Description ^
 +| //''parentPrefabIdOrPath''// | ''string'' | the ID or path to the new child's parent prefab |
 +| //''id''// | ''string'' | the ID of the newly created prefab |
 +| //''name''// | ''string'' | optional, the name of the new prefab, ''id'' will be used if no ''name'' is provided |
 +| //''transform''// | ''matrix'' | optional, the transform matrix of the new prefab |
 +
 +==== Example ====
 +
 +<code lua>
 +local newChildTransform = {
 +    Position = { 0, 0, 1 },
 +    Rotation = { 0, -180, 0 }
 +}
 +
 +myMod:registerPrefabChild(prefabPath, "MY_NEW_PREFAB_CHILD_ID", "MyNewChildName", newChildTransform)
 +</code>
  
 ---- ----
mod-management-functions.txt · Last modified: 2022/10/07 11:18 by maxime

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki