Constructor CustomPiece
| Improve this Doc View SourceCustomPiece(GameObject, string, bool)
Custom piece from a prefab.
Will be added to the PieceTable provided by name.
Can fix references from Mock<T>s or not.
Will be added to the PieceTable provided by name.
Can fix references from Mock<T>s or not.
Declaration
public CustomPiece(GameObject piecePrefab, string pieceTable, bool fixReference)
Parameters
Type | Name | Description |
---|---|---|
GameObject | piecePrefab | The prefab for this custom piece. |
string | pieceTable | Name of the PieceTable the custom piece should be added to. Can by the "internal" or the GameObjects name (e.g. "_PieceTableHammer" or "Hammer") |
bool | fixReference | If true references for Mock<T> objects get resolved at runtime by Jötunn. |
CustomPiece(GameObject, bool, PieceConfig)
Custom piece from a prefab with a PieceConfig attached.
The members and references from the PieceConfig will be referenced by Jötunn at runtime.
The members and references from the PieceConfig will be referenced by Jötunn at runtime.
Declaration
public CustomPiece(GameObject piecePrefab, bool fixReference, PieceConfig pieceConfig)
Parameters
Type | Name | Description |
---|---|---|
GameObject | piecePrefab | The prefab for this custom piece. |
bool | fixReference | If true references for Mock<T> objects get resolved at runtime by Jötunn. |
PieceConfig | pieceConfig | The PieceConfig for this custom piece. |
CustomPiece(AssetBundle, string, string, bool)
Custom piece from a prefab loaded from an AssetBundle.
Will be added to the PieceTable provided by name.
Can fix references from Mock<T>s or not.
Will be added to the PieceTable provided by name.
Can fix references from Mock<T>s or not.
Declaration
public CustomPiece(AssetBundle assetBundle, string assetName, string pieceTable, bool fixReference)
Parameters
Type | Name | Description |
---|---|---|
AssetBundle | assetBundle | A preloaded AssetBundle |
string | assetName | Name of the prefab in the bundle. |
string | pieceTable | Name of the PieceTable the custom piece should be added to. Can by the "internal" or the GameObjects name (e.g. "_PieceTableHammer" or "Hammer") |
bool | fixReference | If true references for Mock<T> objects get resolved at runtime by Jötunn. |
CustomPiece(AssetBundle, string, bool, PieceConfig)
Custom piece from a prefab loaded from an AssetBundle with a PieceConfig attached.
The members and references from the PieceConfig will be referenced by Jötunn at runtime.
The members and references from the PieceConfig will be referenced by Jötunn at runtime.
Declaration
public CustomPiece(AssetBundle assetBundle, string assetName, bool fixReference, PieceConfig pieceConfig)
Parameters
Type | Name | Description |
---|---|---|
AssetBundle | assetBundle | A preloaded AssetBundle |
string | assetName | Name of the prefab in the bundle. |
bool | fixReference | If true references for Mock<T> objects get resolved at runtime by Jötunn. |
PieceConfig | pieceConfig | The PieceConfig for this custom piece. |
CustomPiece(string, bool, string)
Custom piece created as an "empty" primitive.
Will be added to the PieceTable provided by name.
Will be added to the PieceTable provided by name.
Declaration
public CustomPiece(string name, bool addZNetView, string pieceTable)
Parameters
Type | Name | Description |
---|---|---|
string | name | Name of the new prefab. Must be unique. |
bool | addZNetView | If true a ZNetView component will be added to the prefab for network sync. |
string | pieceTable | Name of the PieceTable the custom piece should be added to. Can by the "internal" or the GameObjects name (e.g. "_PieceTableHammer" or "Hammer") |
CustomPiece(string, bool, PieceConfig)
Custom piece created as an "empty" primitive with a PieceConfig attached.
The members and references from the PieceConfig will be referenced by Jötunn at runtime.
The members and references from the PieceConfig will be referenced by Jötunn at runtime.
Declaration
public CustomPiece(string name, bool addZNetView, PieceConfig pieceConfig)
Parameters
Type | Name | Description |
---|---|---|
string | name | Name of the new prefab. Must be unique. |
bool | addZNetView | If true a ZNetView component will be added to the prefab for network sync. |
PieceConfig | pieceConfig | The PieceConfig for this custom piece. |
CustomPiece(string, string, string)
Custom piece created as a copy of a vanilla Valheim prefab.
Will be added to the PieceTable provided by name.
Will be added to the PieceTable provided by name.
Declaration
public CustomPiece(string name, string baseName, string pieceTable)
Parameters
Type | Name | Description |
---|---|---|
string | name | The new name of the prefab after cloning. |
string | baseName | The name of the base prefab the custom item is cloned from. |
string | pieceTable | Name of the PieceTable the custom piece should be added to. Can by the "internal" or the GameObjects name (e.g. "_PieceTableHammer" or "Hammer") |
CustomPiece(string, string, PieceConfig)
Custom piece created as a copy of a vanilla Valheim prefab with a PieceConfig attached.
The members and references from the PieceConfig will be referenced by Jötunn at runtime.
The members and references from the PieceConfig will be referenced by Jötunn at runtime.
Declaration
public CustomPiece(string name, string baseName, PieceConfig pieceConfig)
Parameters
Type | Name | Description |
---|---|---|
string | name | The new name of the prefab after cloning. |
string | baseName | The name of the base prefab the custom item is cloned from. |
PieceConfig | pieceConfig | The PieceConfig for this custom piece. |