Class CustomPiece
Main interface for adding custom pieces to the game.
All custom pieces have to be wrapped inside this class to add it to Jötunns PieceManager.
All custom pieces have to be wrapped inside this class to add it to Jötunns PieceManager.
Inherited Members
Namespace: Jotunn.Entities
Assembly: Jotunn.dll
Syntax
public class CustomPiece : CustomEntity
Constructors
Name | Description |
---|---|
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. |
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. |
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. |
CustomPiece(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. |
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. |
CustomPiece(string, bool, string) | Custom piece created as an "empty" primitive. Will be added to the PieceTable provided by name. |
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. |
CustomPiece(string, string, string) | Custom piece created as a copy of a vanilla Valheim prefab. Will be added to the PieceTable provided by name. |
Properties
Name | Description |
---|---|
Category | Name of the category this custom piece belongs to. When setting this value, Piece.m_category will be updated as well. |
FixReference | Indicator if references from Mock<T>s will be replaced at runtime. |
Piece | The Piece component for this custom piece as a shortcut. |
PiecePrefab | The prefab for this custom piece. |
PieceTable | Name of the PieceTable this custom piece belongs to. |
Methods
Name | Description |
---|---|
Equals(object) | Determines whether the specified object is equal to the current object. |
GetHashCode() | Serves as the default hash function. |
IsCustomPiece(string) | Helper method to determine if a prefab with a given name is a custom piece created with Jötunn. |
IsValid() | Checks if a custom piece is valid (i.e. has a prefab, a target PieceTable is set, has a Piece component and that component has an icon). |
ToString() | Returns a string that represents the current object. |